scottchiefbaker / dool

Python3 compatible fork of dstat
GNU General Public License v3.0
323 stars 64 forks source link

Skip devices without I/O #1

Closed TobiX closed 1 year ago

TobiX commented 3 years ago

Linux 4.18+ has added more fields to the diskstats proc file, so the original skip condition for devices without I/O didn't apply anymore.

Before:

$ ./dool -af 1 5
Terminal width too small, trimming output.
--total-cpu-usage-- -dsk/loop0---dsk/loop1---dsk/loop2---dsk/loop3---dsk/loop4---dsk/loop5---dsk/loop6---dsk/loop7----dsk/sda-----dsk/sdb-- net/docker0--net/wlp2s0>
usr sys idl wai stl| read  writ: read  writ: read  writ: read  writ: read  writ: read  writ: read  writ: read  writ: read  writ: read  writ| recv  send: recv  send>
 24   8  69   0   0|   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 : 660k  982k: 138b 1467k|   0     0 :   0     0 >
  4   3  85   8   0|   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0   312M|   0     0 :5328b 3744b>
  4   2  84  10   0|   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0   317M|   0     0 :5432b 3784b>
  4   1  85   9   0|   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0   315M|   0     0 :2704b 1104b>
  4   3  82  11   0|   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0     0 :   0   315M|   0     0 :2744b 1160b>

After:

$ ./dool -af 1 5
--total-cpu-usage-- --dsk/sda-----dsk/sdb-- net/docker0--net/wlp2s0 ---paging-- ------memory-usage----- ---system-- ---procs--- ---load-avg--- -----system----
usr sys idl wai stl| read  writ: read  writ| recv  send: recv  send|  in   out | used  free  buff  cach| int   csw |run blk new| 1m   5m  15m |      time     
 24   8  68   0   0| 661k  983k: 138b 1297k|   0     0 :   0     0 | 642B 4495B|5357M  959M  342M 1791M|1083  3476 |  0 1.0 0.4|2.50 2.25 1.57|Sep-30 13:48:32
  3   2  87   8   0|   0     0 :   0   315M|   0     0 :6352b 4872b|   0     0 |5355M  961M  342M 1789M|3617    11k|  0 1.0   0|2.38 2.23 1.56|Sep-30 13:48:33
  6   4  81  10   0|   0     0 :   0   318M|   0     0 :3048b 5016b|   0     0 |5347M  970M  342M 1789M|4034    13k|  0 1.0   0|2.38 2.23 1.56|Sep-30 13:48:34
  6   2  83  10   0|   0   623k:   0   319M|   0     0 :  15k 6184b|   0     0 |5342M  974M  342M 1776M|3809    12k|  0 1.0   0|2.38 2.23 1.56|Sep-30 13:48:35
  4   3  80  14   0|   0     0 :   0   319M|   0     0 :2736b 8280b|   0     0 |5342M  974M  342M 1775M|3605    11k|1.0 1.0   0|2.38 2.23 1.56|Sep-30 13:48:36
scottchiefbaker commented 1 year ago

Apologies... Github was not sending me alerts for issues and pull requests on this repo. I did not see this until just now.

Is this still relevant? I'm working through some backlog.

TobiX commented 1 year ago

Yes, this is still relevant and the fix still works

TobiX commented 1 year ago

But #17 is probably the better fix, feel free to merge that instead.

scottchiefbaker commented 1 year ago

I very much appreciate the contribution. I wish I had seen it sooner, but GitHub didn't send me any updates from this repo until two days ago. I've missed out on 2+ years of PRs and issues. I didn't think anyone was using dool. Clearly I was wrong.

Please feel free to contribute in the future. I will do my best to be more prompt in responding.