Collecting trough WMI from Win32_PerfRawData_PerfDisk_PhysicalDisk Class, cannot unde


New member
Nov 26, 2012
Programming Experience
Hey i read from WMI to Get the IOPS for a Disk.
but when i get the info i don't understand how to read it , the Numbers are to big.
For Example this is a sample code:
ManagementScope oMs = new System.Management.ManagementScope("root\\cimv2");
ObjectQuery InventQuery = new ObjectQuery("SELECT * FROM Win32_OperatingSystem");
ManagementObjectSearcher Inventsearcher = new ManagementObjectSearcher(oMs, InventQuery);
ManagementObjectCollection InventCollection = Inventsearcher.Get();

foreach (ManagementObject mgt in InventCollection)
outBox.AppendText(mgt["csname"].ToString() + "\n");

ObjectQuery PerfQuery = new ObjectQuery("SELECT * FROM Win32_PerfRawData_PerfDisk_PhysicalDisk");
ManagementObjectSearcher Perfsearcher = new ManagementObjectSearcher(oMs, PerfQuery);
ManagementObjectCollection PerfCollection = Perfsearcher.Get();

foreach (ManagementObject mgt in PerfCollection)
outBox.AppendText("Write IOps: "+ mgt["DiskWritesPerSec"].ToString() + "\n");
outBox.AppendText("Read IOps: " + mgt["DiskReadsPerSec"].ToString() + "\n");
This is the OutPut:
Write IOps: 11994709
Read IOps: 10541530
Numbers are too big how? And for what? I don't fully understand what you want to do or what the issues are. If you'd like some assistance, some more clarity and details is in order :)
Top Bottom