使用WMI查询的perfmon计数器值的问题 [英] Issue with perfmon counter value using WMI query

查看:496
本文介绍了使用WMI查询的perfmon计数器值的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建EXE,通过它我正在获取应用程序的perfmon计数器来监视使用WMI查询。我用我的本地机器测试它,似乎我的代码逻辑给我一些计数器不正确的值。



下面是我的计数器代码( CacheTotalHitRatio



当我用 perfmon exe





我认为 CacheTotalHitRatio 是百分比,不应超过100,但我的代码给出一些更高的价值。这里有什么问题或者我在这里做错了吗?



请让我知道是否有任何人有WMI查询的经验。


$ b $

解决方案

存在两种类型的性能计数器类





Win32_PerfRawData_ASPNET_ASPNETApplications 类返回原始性能计数器值,必须转换这些值(使用根据属性和类的公式)您将使用 Win32_PerfFormattedData_ASPNET_ASPNETApplications 类,您将获得计算所得的数据,就像在性能监视器中显示的那样。


I am building EXE and through which i am fetching perfmon counter of application to monitor that using WMI query. I am testing it with my local machine and seems like my code logic gives me incorrect values for some of counters.

Below is my code for one of the counter (CacheTotalHitRatio)

And when i have looked it with perfmon exe in my system then it shows me something different as shown below.

I think CacheTotalHitRatio is in percentage and should not be go beyond 100 but my code gives some higher value. What is problem here OR am i doing something wrong here?

Please let me know if anyone have experience with WMI query.

Thanks in Advance.

解决方案

Exist two types of Performance Counter Classes

The Win32_PerfRawData_ASPNET_ASPNETApplications class returns the raw performance counter values these values must be transformed (using a formula according to the property and the class) to be displayed, if you uses the Win32_PerfFormattedData_ASPNET_ASPNETApplications class instead you will get the calculated data just as are shown in the Performance monitor.

这篇关于使用WMI查询的perfmon计数器值的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆