Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dstat network metrics

Could anybody say about dstat's network metrics (dstat -n)? Is it Bytes or Bits? Thanks a lot!

like image 422
Kukuruka Avatar asked Jan 14 '13 10:01

Kukuruka


2 Answers

Bytes.. at least from version .3. from changelog:

  • 0.3
    • Added load stats (-l)
    • Added memory stats (-m)
    • Output now fits into space and adds unit
    • Converted all values to bytes

interestingly.. in 0.7.2svn they added bits option

  • 0.7.2svn - ... - release 03/09/2010
    • ...
    • Added new --bits option to force bit-values on screen (Scott Baker)

https://github.com/dagwieers/dstat/blob/master/ChangeLog

like image 104
dornquast Avatar answered Sep 28 '22 00:09

dornquast


I confirmed that the unit for network metric is Bytes/sec

Methodology: I ran some network I/O traffic and measured with dstat

[root@centos72_base ~]# dstat --full
You did not select any stats, using -cdngy by default.
-------cpu0-usage--------------cpu1-usage------ --dsk/sda-- net/eno1677 ---paging-- ---system--
usr sys idl wai hiq siq:usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
  4   0  96   0   0   0:  1   0  99   0   0   0|   0     0 |1205k 9874B|   0     0 | 562   601 
  4   0  96   0   0   0:  0   0 100   0   0   0|   0     0 |1206k   10k|   0     0 | 529   656 
  4   1  95   0   0   0:  4   0  96   0   0   0|   0     0 |1206k   10k|   0     0 | 580   712 
  3   0  97   0   0   0:  2   0  98   0   0   0|   0     0 |1207k   10k|   0     0 | 506   615 

At steady state, I was averaging 1206k. I outputted dtsat to CSV to see the full numbers and got the full values such as 1234196.

Next, I got network metrics using ifconfig.

[cyc@centos72_base one_forward]$ ifconfig; sleep 1; ifconfig; sleep 1; ifconfig
        RX packets 18500852  bytes 42118560051 (39.2 GiB)
        ...
        RX packets 18501061  bytes 42119793977 (39.2 GiB)
        ...
        RX packets 18501286  bytes 42121029469 (39.2 GiB)

ifconfig clearly states network metrics are in GigaBytes. Calculating the difference between two successive seconds: 42119793977 - 42118560051 = 1233926. 1233926 Bytes/sec from ifconfig closely matches 1234196 from dstat. So dstat is outputting in Bytes/sec

like image 29
thekenobe Avatar answered Sep 28 '22 02:09

thekenobe