如何使用WMI调用获取有关系统性能的数字信息? [英] How to get numeric information about system performance using WMI calls?
问题描述
大家好,
为方便起见,我会将问题汇总。我想完成以下任务:
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
推荐答案
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.
这篇关于如何使用WMI调用获取有关系统性能的数字信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!