如何使用WMI调用获取有关系统性能的数字信息? [英] How to get numeric information about system performance using WMI calls?

查看:104
本文介绍了如何使用WMI调用获取有关系统性能的数字信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

为方便起见,我会将问题汇总。我想完成以下任务:

I'll make the question summarized for your convenience. I want to achieve the following task:

- 能够在一段持续的时间内测量系统性能。

-To be able to measure system performance over a sustained period of time.

我想要的方式通过执行以下操作来解决该任务:

The way I intend to tackle that task is by doing the following:

- 使用WMI调用以数字和/或百分比形式获取系统性能数据。 (RAM利用率,CPU利用率,电源状态[活动/空闲])。 

-To use WMI calls to get system performance data in a numeric and/or a percentage form. (RAM utilization, CPU utilization, Power state [active/idle]). 

我想要获取的信息完全是您可以在"性能"选项卡下的"任务管理器"中看到的信息。  

The information I am trying to get is EXACTLY the information you can see in Task Manager under Performance tab. 

请帮助。如果您认为有比使用WMI呼叫更好的方法,我可以更乐意接受您的建议并应用它!

Please help. If you think there is a better way to do this than using WMI calls, I couldn't be more glad to take your advice and apply it!!

提前致谢!

Ray




推荐答案

有一种更好的方法。
使用PDH功能调用
。这使您尽可能接近操作系统提供的性能计数器。

了解更多信息这里。

There is a better way. Use PDH function calls. This gets you as close as you can get to the performance counters provided by the operating system. Read more about it here.

这里的例子。

此处的Codeproject示例

here


这篇关于如何使用WMI调用获取有关系统性能的数字信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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