Пример #1
0
 public bool SetPerfTransfer(MemSpoofer memSpf, CpuSpoofer cpuSpf)
 {
     try
     {
         //Thread.Sleep(300);
         perf_Transfer.VMName               = VMName;
         perf_Transfer.CPUCount             = cpuSpf.CPUCount;
         perf_Transfer.ProcessorQueueLength = cpuSpf.ProcessorQueueLength;
         perf_Transfer.CPUProcessorTime     = cpuSpf.CPUProcessorTime;
         perf_Transfer.CPUPrivilegedTime    = cpuSpf.CPUPrivilegedTime;
         perf_Transfer.CPUInterruptTime     = cpuSpf.CPUInterruptTime;
         perf_Transfer.CPUDPCTime           = cpuSpf.CPUDPCTime;
         perf_Transfer.MEMAvailable         = memSpf.MEMAvailable;
         perf_Transfer.MEMCommited          = memSpf.MEMCommited;
         perf_Transfer.MEMCommitLimit       = memSpf.MEMCommitLimit;
         perf_Transfer.MEMCommitedPerc      = memSpf.MEMCommitedPerc;
         perf_Transfer.MEMCached            = memSpf.MEMCached;
         perf_Transfer.MEMPoolPaged         = memSpf.MEMPoolPaged;
         perf_Transfer.MEMPoolNonPaged      = memSpf.MEMPoolNonPaged;
         perf_Transfer.PageFile             = memSpf.PageFile;
         perf_Transfer.PagesPerSec          = memSpf.PagesPerSec;
         perf_Transfer.PageFaultsPerSec     = memSpf.PageFaultsPerSec;
         perf_Transfer.PageReadsPerSec      = memSpf.PageReadsPerSec;
         perf_Transfer.PageWritesPerSec     = memSpf.PageWritesPerSec;
         perf_Transfer.PagesInputPerSec     = memSpf.PagesInputPerSec;
         perf_Transfer.PagesOutputPerSec    = memSpf.PagesOutputPerSec;
         return(true);
     }
     catch (Exception exp)
     {
         Console.WriteLine(exp.Message, "SetPerfTransfer异常");
         return(false);
     }
 }
Пример #2
0
        public PerformanceInfo()
        {
            memSpoofer = new MemSpoofer();
            cpuSpoofer = new CpuSpoofer();
            memSpoofer.RefreshMEMArg();
            cpuSpoofer.RefreshCPUArg();

            bool vmIDRet = GetVMName(@"C:\VMID.txt");

            if (!vmIDRet)
            {
                VMName = "Unknown";
            }
            bool ret = SetPerfTransfer(memSpoofer, cpuSpoofer);
        }