Beispiel #1
0
        public void PageUpdate()
        {
            //cpuUseage = (int)(MPERF_GetCpuUseAge2());

            if (!notDrawGrid)
            {
                if (showKernelTime)
                {
                    int cpuKernelTime = (int)(cpuUseage - MPERF_GetCpuUseAgeUser2());
                    performanceGridGlobal.AddData2(cpuKernelTime);
                }
                performanceGridGlobal.AddData(cpuUseage);
                performanceGridGlobal.Invalidate();
            }

            item_cpuuseage.Value = cpuUseage.ToString() + "%";
            if (MSystemPerformanctMonitor.UpdatePerformance())
            {
                item_process_count.Value = MSystemPerformanctMonitor.GetProcessCount().ToString();
                item_thread_count.Value  = MSystemPerformanctMonitor.GetThreadCount().ToString();
                item_handle_count.Value  = MSystemPerformanctMonitor.GetHandleCount().ToString();
                times = TimeSpan.FromMilliseconds(Convert.ToDouble(MSystemPerformanctMonitor.GetSystemRunTime()));
                item_run_time.Value = times.Days + ":" + times.Hours.ToString("00") + ":" + times.Minutes.ToString("00") + ":" + times.Seconds.ToString("00");
                if (cpuCount > 1)
                {
                    if (notDrawGrid)
                    {
                        performanceCpusAll.Invalidate();
                    }
                    else
                    {
                        performanceCpus.Invalidate();
                    }
                }
                performanceInfos.UpdateSpeicalItems();
            }
        }
Beispiel #2
0
        public void PageUpdate()
        {
            int ramuse = (int)(MPERF_GetRamUseAge2() * 100);

            performanceGridGlobal.AddData(ramuse);
            performanceGridGlobal.Invalidate();

            if (MSystemPerformanctMonitor.UpdatePerformance())
            {
                MSystemMemoryPerformanctMonitor.UpdateMemoryListInfo();

                ulong pagesize               = MSystemPerformanctMonitor.GetPageSize();
                ulong availableSize          = MSystemMemoryPerformanctMonitor.GetMemoryAvail();
                ulong usedSize               = all_ram - availableSize;
                ulong compressedSize         = 0;
                ulong compressedEstimateSize = 0;
                ulong compressedSavedSize    = 0;
                ulong modifedSize            = MSystemMemoryPerformanctMonitor.GetModifiedSize();
                ulong standbySize            = MSystemMemoryPerformanctMonitor.GetStandBySize();
                ulong freeSize               = availableSize - modifedSize - standbySize;
                ulong divier = all_ram / 1048576;

                if (!compressInfoFailed)
                {
                    MSystemMemoryPerformanctMonitor.SYSTEM_COMPRESSION_INFO compressionInfo = new MSystemMemoryPerformanctMonitor.SYSTEM_COMPRESSION_INFO();
                    if (MSystemMemoryPerformanctMonitor.GetMemoryCompressionInfo(ref compressionInfo))
                    {
                        compressedSize         = compressionInfo.CompressionWorkingSetSize;
                        compressedEstimateSize = compressionInfo.CompressedSize;
                        if (compressedEstimateSize > compressedSize)
                        {
                            compressedSavedSize = compressedEstimateSize - compressedSize;
                        }
                    }
                    else
                    {
                        fTipVauleUsing     = LanuageMgr.GetStr("MemTipUsingS");
                        compressInfoFailed = true;
                    }
                }

                performanceRamPoolGrid.VauleUsing       = (usedSize / 1048576) / (double)(divier);
                performanceRamPoolGrid.VauleModified    = (modifedSize / 1048576) / (double)(divier);
                performanceRamPoolGrid.VauleStandby     = (standbySize / 1048576) / (double)(divier);
                performanceRamPoolGrid.VauleFree        = (freeSize / 1048576) / (double)(divier);
                performanceRamPoolGrid.StrVauleUsing    = FormatFileSize(usedSize);
                performanceRamPoolGrid.StrVauleModified = FormatFileSize(modifedSize);
                performanceRamPoolGrid.StrVauleStandby  = FormatFileSize(standbySize);
                performanceRamPoolGrid.StrVauleFree     = FormatFileSize(freeSize);
                performanceRamPoolGrid.TipVauleFree     = string.Format(fTipVauleFree, performanceRamPoolGrid.StrVauleFree);
                performanceRamPoolGrid.TipVauleModified = string.Format(fTipVauleModified, performanceRamPoolGrid.StrVauleModified);
                performanceRamPoolGrid.TipVauleStandby  = string.Format(fTipVauleStandby, performanceRamPoolGrid.StrVauleStandby);

                if (compressInfoFailed)
                {
                    performanceRamPoolGrid.TipVauleUsing = string.Format(fTipVauleUsing, performanceRamPoolGrid.StrVauleUsing);
                }
                else
                {
                    performanceRamPoolGrid.TipVauleUsing = string.Format(fTipVauleUsing, performanceRamPoolGrid.StrVauleUsing, FormatFileSize(compressedSize), FormatFileSize(compressedEstimateSize), NativeMethods.FormatFileSize(compressedSavedSize));
                }

                performanceRamPoolGrid.Invalidate();

                if (compressInfoFailed)
                {
                    item_ramuseage.Value = FormatFileSize(usedSize);
                }
                else
                {
                    item_ramuseage.Value = FormatFileSize(usedSize) + " (" + FormatFileSize(compressedSize) + ")";
                }

                item_ramcanuse.Value = FormatFileSize(availableSize);

                item_sended.Value     = FormatFileSize(pagesize * MSystemMemoryPerformanctMonitor.GetCommitTotal()) + "/" + FormatFileSize(pagesize * MSystemMemoryPerformanctMonitor.GetCommitLimit());
                item_cached.Value     = FormatFileSize(pagesize * MSystemMemoryPerformanctMonitor.GetSystemCacheSize());
                item_nopagepool.Value = FormatFileSize(pagesize * MSystemMemoryPerformanctMonitor.GetKernelNonpaged());
                item_pagepool.Value   = FormatFileSize(pagesize * MSystemMemoryPerformanctMonitor.GetKernelPaged());
                performanceInfos.Invalidate();
            }
        }