2016-10-05 389 views

回答

0

各項統計Windows已可以使用其Powershell的API來acessed:

獲取櫃檯 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有類似的東西。

名爲 「\物理磁盤(*)\平均磁盤秒/傳輸」 措施的時間上花費的計數器:
- 類驅動程序
- 端口驅動程序
- 設備微型端口驅動程序
- 磁盤子系統

因此,例如我們可以監控這些統計信息:

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/