Ami*_*ein 10 memory windows cpu cpu-usage command-line
我想每 10 分钟记录一次正在运行的 Windows 中所有应用程序的列表、CPU 使用情况和内存使用情况。
我有很多 node.exe 任务,所以我想查看任务的参数(例如: node c:\myscript.js
我试过:tasklist/?
但没有发现任何与 cpu 使用相关的东西。
我试过了:procexp/?
但无论如何都没有找到将列表导出到文件(或在控制台中显示)
我试过:cprocess
(NirSoft),它可以转储到文件,并显示 CPU,但它不提供运行的 exe 的参数。
任何的想法?
Iel*_*ton 10
您可以使用该工具typeperf
。
列出所有进程:
typeperf "\Process(*)\% Processor Time" -sc 1
Run Code Online (Sandbox Code Playgroud)
列出所有进程,每隔 10 秒取 5 个样本:
typeperf "\Process(*)\% Processor Time" -si 10 -sc 5
Run Code Online (Sandbox Code Playgroud)
如果你想要一个特定的进程,例如节点:
typeperf "\Process(node)\% Processor Time" -si 10 -sc 5
Run Code Online (Sandbox Code Playgroud)
您还可以将其转储到 csv 文件并在电子表格中进行过滤以远程诊断问题。
以下给了我所有进程的 5 分钟(以 10 秒为间隔)。数据不仅包括 % Processor Time,还包括 IO、内存、分页等。
typeperf -qx "\Process" > config.txt
typeperf -cf config.txt -o perf.csv -f CSV -y -si 10 -sc 60
Run Code Online (Sandbox Code Playgroud)
更多信息:https : //technet.microsoft.com/en-us/library/bb490960.aspx