예제 #1
0
        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;
            }
        }
예제 #2
0
파일: DataNode.cs 프로젝트: hch-im/ptopw
 public DataNode()
 {
     time = 0;
     pData = new ArrayList();
     sData = null;
     pEnergy = new Hashtable();
     sEnergy = null;
 }
예제 #3
0
파일: StatData.cs 프로젝트: hch-im/ptopw
 //invoked before addProcessInfo
 public void addSystemInfo(SystemInfo sysInfo)
 {
     tempNode.sData = sysInfo;
 }
예제 #4
0
파일: EnergyModel.cs 프로젝트: hch-im/ptopw
 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);
 }
예제 #5
0
파일: EnergyModel.cs 프로젝트: hch-im/ptopw
 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);
 }
예제 #6
0
파일: EnergyModel.cs 프로젝트: hch-im/ptopw
        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;
        }
예제 #7
0
파일: EnergyModel.cs 프로젝트: hch-im/ptopw
 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;
 }
예제 #8
0
파일: EnergyModel.cs 프로젝트: hch-im/ptopw
 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;
 }