【发布时间】:2017-02-13 07:17:06
【问题描述】:
我们在 UNIX 中使用 iostat 在 unix 中获取所有这些信息。我可以在 Windows 中执行此操作。目前我们使用 typeperf。
【问题讨论】:
标签: windows command-line io command-line-interface
我们在 UNIX 中使用 iostat 在 unix 中获取所有这些信息。我可以在 Windows 中执行此操作。目前我们使用 typeperf。
【问题讨论】:
标签: windows command-line io command-line-interface
还有一个实用程序“logman”。 关于这个主题的链接: 克林特霍夫曼博客和书籍 http://blogs.technet.com/b/clinth/ http://www.amazon.com/dp/0124167012/ref=wl...=I2TOVTYHI6HDHC
【讨论】:
可以使用其 Powershell API 访问 Windows 的所有统计信息:
获取计数器 https://technet.microsoft.com/en-us/library/hh849685.aspx
所以,例如,如果你这样做:
Set-Alias grep Select-String
(Get-Counter -List PhysicalDisk).PathsWithInstances | grep "C:"
您将获得一份包含所有统计信息的列表 C: 驱动器
\PhysicalDisk(0 C:)\Current Disk Queue Length
\PhysicalDisk(0 C:)\% Disk Time
\PhysicalDisk(0 C:)\Avg. Disk Queue Length
\PhysicalDisk(0 C:)\% Disk Read Time
\PhysicalDisk(0 C:)\Avg. Disk Read Queue Length
\PhysicalDisk(0 C:)\% Disk Write Time
\PhysicalDisk(0 C:)\Avg. Disk Write Queue Length
\PhysicalDisk(0 C:)\Avg. Disk sec/Transfer
\PhysicalDisk(0 C:)\Avg. Disk sec/Read
\PhysicalDisk(0 C:)\Avg. Disk sec/Write
\PhysicalDisk(0 C:)\Disk Transfers/sec
\PhysicalDisk(0 C:)\Disk Reads/sec
\PhysicalDisk(0 C:)\Disk Writes/sec
\PhysicalDisk(0 C:)\Disk Bytes/sec
\PhysicalDisk(0 C:)\Disk Read Bytes/sec
\PhysicalDisk(0 C:)\Disk Write Bytes/sec
\PhysicalDisk(0 C:)\Avg. Disk Bytes/Transfer
\PhysicalDisk(0 C:)\Avg. Disk Bytes/Read
\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write
\PhysicalDisk(0 C:)\% Idle Time
\PhysicalDisk(0 C:)\Split IO/Sec
来自 iostat 的手册页 (http://linuxcommand.org/man_pages/iostat1.html)
svctm
The average service time (in milliseconds) for I/O
requests that were issued to the device.
await
The average time (in milliseconds) for I/O requests
issued to the device to be served. This includes the time
spent by the requests in queue and the time spent servicing them.
我遵循这些解释:
https://unix.stackexchange.com/questions/104192/iostat-await-vs-svctm
http://www.xaprb.com/blog/2010/09/06/beware-of-svctm-in-linuxs-iostat/
包括不应该再使用svctm的讨论。
如果你看到https://blogs.technet.microsoft.com/askcore/2012/02/07/measuring-disk-latency-with-windows-performance-monitor-perfmon/,你会看到Windows有类似的东西。
名为“\PhysicalDisk(*)\Avg. Disk sec/Transfer”的计数器测量花费在以下方面的时间:
- 类驱动程序
- 端口驱动程序
- 设备微型端口驱动程序
- 磁盘子系统
因此,例如,我们可以通过以下方式监控这些统计信息:
Get-Counter -Counter "\PhysicalDisk(0 C:)\% Disk Time"
Get-Counter -Counter "\PhysicalDisk(0 C:)\Avg. Disk sec/Transfer"
或者如果您愿意,可以选择更“流水线”的版本:
"\PhysicalDisk(0 C:)\% Disk Time","\PhysicalDisk(0 C:)\Avg. Disk sec/Transfer" >> counters.txt
cat counters.txt | Get-Counter
有关每个计数器的更详细说明,请参阅:
https://blogs.technet.microsoft.com/askcore/2012/03/16/windows-performance-monitor-disk-counters-explained/
【讨论】: