是否有可能知道,从脚本​​的cpu利用率 [英] Is it possible to know the cpu utilization from a script

查看:107
本文介绍了是否有可能知道,从脚本​​的cpu利用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何命令或可能的方式,以了解有关命令行或批处理脚本?

Is there any command or possible way to know the cpu utilization in windows operating system for use on the command line or in a batch script?

推荐答案

要确定一般使用情况,您可以使用mcstellar和沃伦的回答。此外,还可以选择:

To determine the usage in general, you can use mcstellar and warren's answer. You also have the option of:

列出所有进程:

typeperf\\程序(*)\\%处理器时间-sc 1

列出所有的进程,采取5个样品以10秒间隔:

List all processes, take 5 samples at 10 second intervals:

typeperf\\程序(*)\\%处理器时间-si ​​10 -sc 5

如果你想有一个特定的进程,RTVSCAN例如:

If you want a specific process, Rtvscan for example:

typeperf\\流程(RTVSCAN)\\%处理器时间-si ​​10 -sc 5

我发现它是非常有用的,只是在监视一段时间内所有的流程活动。然后,我可以把它转储到一个CSV文件和过滤器呈S preadsheet远程诊断问题。

I found it extremely useful to just monitor all process activity over a period of time. I could then dump it to a csv file and filter in a spreadsheet to remotely diagnose issues.

下面给我的所有进程的5分钟(以10秒间隔)。该数据不仅包括处理器时间百分比,但IO,内存,分页等。

The following gives me 5 minutes (at 10 second intervals) of all processes. The data includes not just % Processor Time, but IO, memory, paging, etc.

typeperf -qx\\程序> config.txt的
typeperf -CF config.txt的-o perf.csv -f CSV -y -si 10 -sc 60

这篇关于是否有可能知道,从脚本​​的cpu利用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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