int wnicIndex; //the index of the wireless network interface #endregion Fields #region Constructors public DataStatistics(Hashtable param) { SaveResult = PublicFuns.str2Int32((String)param["SaveResult"], 1); FileName = (String)param["FileName"]; StatisticLevel = PublicFuns.str2Int32((String)param["StatisticLevel"], 0); wnicIndex = PublicFuns.str2Int32((String)param["WNICIndex"], 0); tempData = new StatData(param); hasWNIC = false; sysInfo = new SystemInfo(); win32ProcessorObj = RetrieveManagementObject("Win32_Processor"); processor.update(win32ProcessorObj); sysInfo.pro = processor; try { getSystemInfo(); createSystemCounters(); initLog(); } catch (MyException ex) { throw ex; } }
public DataNode() { time = 0; pData = new ArrayList(); sData = null; pEnergy = new Hashtable(); sEnergy = null; }
//invoked before addProcessInfo public void addSystemInfo(SystemInfo sysInfo) { tempNode.sData = sysInfo; }
public void systemEnergy(SystemInfo info, SystemEnergy se) { MaxFrequency = info.pro.MaxClockSpeed; DiskEnergy(info.percentDiskIdleTime, info.percentDiskReadTime, info.percentDiskWriteTime, info.timeInterval, se); NICEnergy(info.nrecv, info.nsend, info.timeInterval, se); MemoryEnergy(info.memRead, info.memWrite, info.memCopy, info.timeInterval,info.pageSize, se); CPUEnergy(info.cpuFrequency, info.cpuTime, info.timeInterval, info.pro.NumberOfCores, se); }
public void processEnergy(ProcessInfo info, SystemEnergy se, SystemInfo sinfo,ProcessEnergy pe) { pCPUEnergy(info, pe, sinfo, se); pNICEnergy(info, pe, se, sinfo); pDiskEnergy(info, pe, se, sinfo); pMemoryEnergy(info, pe, se, sinfo); }
void pNICEnergy(ProcessInfo pinfo, ProcessEnergy peng, SystemEnergy seng, SystemInfo sinfo) { if(pinfo.networkActive && sinfo.NetActiveProcessNum > 0) { peng.nicEng = seng.nicEng / sinfo.NetActiveProcessNum; } else{ peng.nicEng = 0; } peng.nicPower = peng.nicEng * 1000 / sinfo.timeInterval; }
void pMemoryEnergy(ProcessInfo pinfo, ProcessEnergy peng, SystemEnergy seng, SystemInfo sinfo) { peng.memEng = seng.memEng * ((pinfo.dwrite + pinfo.dread) * 1.0 / (sinfo.diskRead + sinfo.diskWrite)); peng.memPower = peng.memEng * 1000 / sinfo.timeInterval; }
void pCPUEnergy(ProcessInfo info, ProcessEnergy pe, SystemInfo sinfo, SystemEnergy se) { pe.cpuEng = se.cpuEng * info.cpuTime / (sinfo.cpuTime); pe.cpuPower = pe.cpuEng * 1000 / sinfo.timeInterval; }