speedometer出網路圖`很小很強大~

weixin_34319999發表於2017-11-14
 今天在強大的網路上發先一個很小很強大的軟體,出圖效果很不錯~~所以介紹給大家。`安裝很方便``只要你的系統支援 python  但是如果你沒有安裝 python-urwid 不會出圖,只會有數字顯示~~好了下面講安裝~~
 
PS :需要 python 2.6 以上支援~
 
shell $> apt-get install python-urwid
shell $> cp speedometer.py /usr/local/bin/speedometer
shell $> chown root: /usr/local/bin/speedometer
shell $> chmod 755 /usr/local/bin/speedometer
shell $> speedometer.py
/usr/local/bin/speedometer.py:21: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
  import popen2
Usage: speedometer [options] tap [[-c] tap]...
Monitor network traffic or speed/progress of a file transfer.  At least one
tap must be entered.  -c starts a new column, otherwise taps are piled
vertically.
Taps:
  [-f] filename [size]        display download speed [with progress bar]
                              -f must be used if directly following another
                              file tap without an expected size specified
  -rx network-interface       display bytes received on network-interface
  -tx network-interface       display bytes transmitted on network-interface
Options:
  -i interval-in-seconds      eg. "5" or "0.25"   default: "1"
  -p                          use plain-text display (one tap only)
  -b                          use old blocky display instead of smoothed
                              display even when UTF-8 encoding is detected
  -z                          report zero size on files that don't exist
                              instead of waiting for them to be created
Python Version: 2.6
Urwid >= 0.8.9 detected: yes  Urwid >= 0.9.1 and UTF-8 encoding detected: yes
##上面是幫助~~~
 
shell $> speedometer.py -rx eth0 -c -tx eth0
 
顯示如圖:
 
還可以測試磁碟讀寫速度出圖``:
shell $> dd if=/dev/zero of=big_nothing bs=102M count=3 & 
##注意我是在虛擬機器上所以用了小檔案,如果你在伺服器可以建立一個大檔案,這樣測試才有效果~
shell $> speedometer.py big_nothing


本文轉自Deidara 51CTO部落格,原文連結:http://blog.51cto.com/deidara/245232,如需轉載請自行聯絡原作者

相關文章