`
linkyou66
  • 浏览: 228412 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

客户端性能测试通过performanceCounter监控客户端性能指标

 
阅读更多
<p> PerformanceCounter PTCounter = new PerformanceCounter("Process",<br> "% Processor Time",<br> "AliIM");<br> logfile("% Processor Time:" + PTCounter.NextValue().ToString());<br> //内存<br> PerformanceCounter WSCounter = new PerformanceCounter("Process",<br> "Working Set",<br> "AliIM");<br> logfile("Working Set:" + ((double)WSCounter.NextValue() / 1024).ToString());</p>
<p> //内存最高值<br> PerformanceCounter MemeryCounter = new PerformanceCounter("Process",<br> "Working Set Peak",<br> "AliIM");<br> logfile("Working Set Peak:" + ((double)MemeryCounter.NextValue() / 1024).ToString());</p>
<p><br> //虚拟内存<br> PerformanceCounter PBCounter = new PerformanceCounter("Process",<br> "Private Bytes",<br> "AliIM");<br> logfile("Private Bytes:" + ((double)PBCounter.NextValue() / 1024).ToString());</p>
<p> //句柄数<br> PerformanceCounter HCCounter = new PerformanceCounter("Process",<br> "Handle Count",<br> "AliIM");<br> logfile("Handle Count:" + HCCounter.NextValue() .ToString());</p>
<p> //线程数Thread Count<br> PerformanceCounter TCCounter = new PerformanceCounter("Process",<br> "Thread Count",<br> "AliIM");<br> logfile("Thread Count:" + TCCounter.NextValue() .ToString());</p>
<p></p>
<p>//补充得到GDI OBJECTS</p>
<p> Process process;<br> process = System.Diagnostics.Process.GetProcessesByName("AliIM")[0];<br><br> logfile("GDI Objects Count:" + GetGuiResources(process.Handle, 0));</p>
<p></p>
<p> [DllImport("User32")]</p>
<p> extern public static int GetGuiResources(IntPtr hProcess, int uiFlags);</p>
<p></p>
<p></p>
<p></p>
<p></p>
分享到:
评论

相关推荐

    C# 通过读取windows性能计数器监控系统运行参数

    参考 https://blog.csdn.net/a497785609/article/details/83316165#9273731

    C#利用性能计数器监控网络状态

    本例是利用C#中的性能计数器(PerformanceCounter)监控网络的状态。并能够直观的展现出来 涉及到的知识点: PerformanceCounter,表示 Windows NT 性能计数器组件。NextValue() 即获取计数器样本并为其返回计算所得...

    详解C#获取特定进程CPU和内存使用率

    当有了进程对象后,可以通过进程对象名称来创建PerformanceCounter类型对象,通过设定PerformanceCounter构造函数的参数实现获取特定进程的CPU和内存使用情况。 具体实例代码如下: 首先是获取本机中所有进程对象,...

    C# 内存处理器、网络上行与下行实时监视器,进程管理

    使用wmi与performancecounter监控实时处理器与内存、网络上行与下行实时监视器,进程管理

    cpu-usage-aspnet-signalr:了解如何构建ASP.NET SignalR + MVC应用程序以实时监视CPU的性能

    使用Hub类时,如何在客户端和服务器之间使用实时通知,如何远程调用服务器和客户端以更新性能数据,通知所有已连接的客户端,了解SmoothieCharts的工作方式,方式和原因我们使用PerformanceCounter类 更多资讯 此...

    C# 监测服务器使用情况(CPU、内存、硬盘、网络宽带、进程)

    分别通过PerformanceCount、ManagementClass、OpenHardwareMonitor、kernel32 来综合获取下面信息: 内存使用率、总CPU百分比、获得物理总内存(、获得可用内存(G)、获取mac地址、获取分区信息使用空间 进程(XX)...

    Performance Counter Tool

    The tool is to collect CPU usage, Physical Memory usage and Disk Used Space on local machine

    vb.net 获取 内存总量、使用量、可用量

    如果你不嫌麻烦,不用花6分下载本工程,直接按照我的提示,花时间学习一下如何使用GlobalMemoryStatusEx方法以及PerformanceCounter,也是可以获得内存信息的,网上多的是,我也是试了一下午研究明白的!结论和网上...

    UseControlsTest.zip

    针对c#的日常可能未注意但是很有用的控件测试demo C# FileSystemWatcher 在监控文件夹和文件时的用法 https://www.cnblogs.com/armyfai/p/4050279.html NotifyICon ...

    进程监视器

    LabVIEW进程监视器,通过PerformanceCounter类获取CPU使用率并确定内存使用数量。Process类可用于获取系统中运行的进程。将在1秒时间后轮询该数据。将该vi置于程序框图中,将打开另一个前面板,用于监视运行电脑的...

    C#编写的网络流量监测器

    使用PerformanceCounter读取网卡的发送、接收、总流量,并用折线图显示网卡流量,或者切换到像360流量监测一样的小显示条(此小显示条模仿360的显示条^-^),程序进驻系统托盘,列出本机网卡,选择网卡进行流量监测,...

    C# 网速监听(WinForm 最新修改)

    &lt;br&gt;其实在本例中并没有用到什么涉及网络的类型 而是通过调用WINDOWS自带的程序Ping.exe 也就是我们平时在cmd中使用的Ping命令,通过取得Ping命令的返回结果 然后对其返回结果通过正则表达式进行字符串...

    个人制作基于C#的资源管理器

    用ListView和TreeView做的,显示进程,文件系统,还有各种电脑性能数据!不知道那个PerformanceCounter如何显示CPU使用程度,还有程序中的BUG和不对之处还望大家指正。联系方式:1023569223@qq.com.

    C#我的电脑资源管理器

    用C#window应用程序实现的,我的电脑资源管理器,实现了比较全的功能

    虚拟硬盘灯

    ThinkPad E系列没有硬盘灯,虽然有HddLed软件,但是设置麻烦,我只需要查看硬盘的读写状态,不需要查看分区读写,利用 PerformanceCounter 监视读写时间的方法设计。代码内有Form1但只作为测试使用,不做实际用途。...

Global site tag (gtag.js) - Google Analytics