【性能学习】Windows自带性能监控工具perform
Windows自带性能监控工具perform
https://blog.csdn.net/burgess_liu/article/details/20563975
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771669(v=ws.10)?redirectedfrom=MSDN
LOG_DEBUG('开启性能数据收集器NO_scan_perf_log')
os.system('Logman start NO_scan_perf_log')
Logman create counter custom_scan_perf_log -f bin -c "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\%% Processor Time" "\Process(test)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(sfavsvc)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(sfavsm)\IO Read Bytes/sec" "\Process(test)\IO Read Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(sfavui)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(sfavsm)\IO Write Bytes/sec" "\Process(test)\IO Write Bytes/sec" "\Process(test)\Working Set - Private" "\Process(edr_agent)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" "\Process(test)\Working Set - Private" -si 00:00:01 -max 500 -cnf 01:00:00 -o C:\PerfMonLogs\custom_scan_perf_log.blg
LOG_DEBUG('结束性能数据收集器NO_scan_perf_log')
os.system('Logman stop NO_scan_perf_log')
会生成C:\PerfMonLogs\NO_scan_perf_log_000134.blg
通过Relog将其转化为csv格式后进行计算
Relog daily_trace_log.blg -f CSV /o 1.csv