public void addProcessInfo(ProcessInfo info) { tempNode.pData.Add(info); }
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 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 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 pCPUEnergy(ProcessInfo info, ProcessEnergy pe, SystemInfo sinfo, SystemEnergy se) { pe.cpuEng = se.cpuEng * info.cpuTime / (sinfo.cpuTime); pe.cpuPower = pe.cpuEng * 1000 / sinfo.timeInterval; }