class ResourceConsumptionManager implements IOFogModule {

	private float getCpuUsage() {
		logDebug("Start get cpu usage");
		String processName = ManagementFactory.getRuntimeMXBean().getName();
		String processId = processName.split("@")[0];

		if (SystemUtils.IS_OS_LINUX) {

			Pair<Long, Long> before = parseStat(processId);
			waitForSecond();
			Pair<Long, Long> after = parseStat(processId);
			logDebug("Finished get cpu usage : " + 100f * (after._1() - before._1()) / (after._2() - before._2()));
			return 100f * (after._1() - before._1()) / (after._2() - before._2());
		} else if (SystemUtils.IS_OS_WINDOWS) {
			String response = getWinCPUUsage(processId);
			logInfo("Finished get cpu usage : " + response);
			return Float.parseFloat(response);
		} else {
			logDebug("Finished get cpu usage : " + 0f);
			return 0f;
		}
	}

	private  ResourceConsumptionManager();

}