WMI query to calculate disk latency

  • I am wondering if any has used WMI query to calculate disk latency. I have this 3rd part cloud monitoring tool which apparently does not capture disk latency by default ( what !!!!!), so i have to create a custom alert to capture drive latency.

    I am open for other ideas also. My goal is to capture drive latency .

     

    Get-WmiObject -Query "select ( $_AvgDisksecPerRead / $_AvgDisksecPerRead_Base) from Win32_PerfRawData_PerfDisk_LogicalDisk where Name='E:' "

  • I've used that but I tend to use sys.dm_io_virtual_file_stats more often. Which way you go can depend on your work environment - as in some may not trust what SQL Server reports for whatever reasons and prefer to monitor the values from windows. But the two usually end up being pretty similar depending on if the server is a dedicated SQL Server or whatever else it may be used for.

    Sue

  • $counter_read_latency = "\PhysicalDisk(*)\Avg. Disk sec/Read"

    $counter_write_latency = "\PhysicalDisk(*)\Avg. Disk sec/Write"

    $counter_read_IOPS = "\PhysicalDisk(*)\Disk Reads/sec"

    $counter_write_IOPS = "\PhysicalDisk(*)\Disk Writes/sec"

    while ($true)

    {

    Clear

    Get-Counter -Counter $counter_read_IOPS -ComputerName $args[0]

    Get-Counter -Counter $counter_write_IOPS -ComputerName $args[0]

    Get-Counter -Counter $counter_read_latency -ComputerName $args[0]

    Get-Counter -Counter $counter_write_latency -ComputerName $args[0]

    Start-Sleep 10

    }

    https://www.universaltailor.com/suit-private-label-manufacturer/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply