systeminformation icon indicating copy to clipboard operation
systeminformation copied to clipboard

Paging/Swapping/per disk I/O

Open mschwartz opened this issue 7 years ago • 9 comments

I'd like to make a couple of suggestions.

On linux, there is a /proc/vmstat that you can open as a file. It contains information on whether the system is currently swapping and/or paging. It would be awesome to have an API to get this info. Not sure if there are OS calls you can make for Windows and MacOS.

Second, it would be nice to get rIO/wIO/tIO/rx_sec/etc. for each disk.

I appreciate the work. This is quite useful.

mschwartz avatar Mar 20 '18 17:03 mschwartz

On linux, you can open /proc/diskstats to get the I/O for each disk.

image

mschwartz avatar Mar 20 '18 17:03 mschwartz

image

mschwartz avatar Mar 20 '18 17:03 mschwartz

Will have a look on it! Thank you for your suggestion.

sebhildebrandt avatar Mar 20 '18 20:03 sebhildebrandt

Hey I just looked into the coding for Disks IO and I think it might be possible to show IO per Disk by just changing line 371 in filesystem.js from

exec('lsblk | grep /', function (error, stdout) {

to

exec('lsblk | grep '+ name , function (error, stdout) {

where name is a sting containing the drive, eg. sda1. If nothing other than the callback is passed just set name to "/" so it will show IO for all Disks. Would be cool to have this feature, but i don't have time till next weekend or so to try it. But i have to say I am still a noob in Linux commands and parsing them in node.

Updated: you only need to pass the direct name

Lolerloli avatar May 16 '18 13:05 Lolerloli

Will check this on friday, ok?

sebhildebrandt avatar May 16 '18 14:05 sebhildebrandt

@sebhildebrandt any chance you could look into this soon? I'd love to have /proc/diskstats for each block device.

Here's an example output from my Unraid machine.

root@Devon:/mnt/user/code# cat /proc/diskstats
   7       0 loop0 3049 0 6278 56895 0 0 0 0 0 398 34893
   7       1 loop1 85 0 326 137 0 0 0 0 0 40 175
   7       2 loop2 100 0 4312 619 245 0 7928 1890 0 451 723
   7       3 loop3 66 0 2704 277 40 0 1056 182 0 150 321
   7       4 loop4 0 0 0 0 0 0 0 0 0 0 0
   7       5 loop5 0 0 0 0 0 0 0 0 0 0 0
   7       6 loop6 0 0 0 0 0 0 0 0 0 0 0
   7       7 loop7 0 0 0 0 0 0 0 0 0 0 0
   8       0 sda 2343 13492 258368 13547 82 4 160 2408 0 6912 17243
   8       1 sda1 2313 13492 256304 13424 82 4 160 2408 0 6884 17100
   8      32 sdc 0 0 0 0 0 0 0 0 0 0 0
   8      48 sdd 8539 283479 2341896 1333016 9706 286739 2371568 1606964 0 82778 2949816
   8      49 sdd1 8528 283479 2341720 1332977 9706 286739 2371568 1606964 0 82736 2949688
   8      80 sdf 168 720 12784 295 7 506 4104 30 0 243 394
   8      81 sdf1 158 720 12664 279 7 506 4104 30 0 228 379
   8      64 sde 169 721 12800 613 18 495 4104 860 0 343 1558
   8      65 sde1 159 721 12680 592 18 495 4104 860 0 320 1534
   8      96 sdg 18767 275104 2356664 318357 10065 285355 2363360 171697 0 30837 502368
   8      97 sdg1 18757 275104 2356544 318333 10065 285355 2363360 171697 0 30809 502134
  11       0 sr0 0 0 0 0 0 0 0 0 0 0 0
   9       1 md1 401 0 20653 0 84265 0 2350961 0 0 0 0
   9       2 md2 98 0 2498 0 1 0 4096 0 0 0 0
   9       3 md3 118 0 2527 0 1 0 4096 0 0 0 0
   8      16 sdb 10 0 80 31 0 0 0 0 1 411916 411916
   8      17 sdb1 7 0 56 27 0 0 0 0 1 411910 411910

For reference: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats

OmgImAlexis avatar Jan 06 '19 02:01 OmgImAlexis

I will add this to version 4.0 (will be released within the next 2 weeks)

sebhildebrandt avatar Jan 06 '19 09:01 sebhildebrandt

To support disk IO on Windows, you could use the win32_PerfFormattedData_PerfDisk_LogicalDisk WMI class.

Sample output:

PS C:\Users\squared> Get-WmiObject -Class win32_PerfFormattedData_PerfDisk_LogicalDisk -Propert
y DiskReadsPerSec


__GENUS          : 2
__CLASS          : Win32_PerfFormattedData_PerfDisk_LogicalDisk
__SUPERCLASS     :
__DYNASTY        :
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
DiskReadsPersec  : 363
PSComputerName   :
PS C:\Users\squared>

GitSquared avatar Feb 22 '19 15:02 GitSquared

@sebhildebrandt did this get added yet?

OmgImAlexis avatar Oct 25 '21 07:10 OmgImAlexis