Linuxã¡ã¢ : topã®ä»£ããã¨ãã¦ä½¿ããããªã³ãã³ãï¼glances, ctop, gtop, htop, vtop, cpustatï¼ã試ãã¦ã¿ã
GitHubãçºãã¦ãããtopã®ä»£ããã¨ãã¦ä½¿ããããªã³ãã³ããè²ã
ãã£ãã®ã§è©¦ãã¦ã¿ãã
glances
Glances - An Eye on your systemï¼å ¬å¼ãã¼ã¸ï¼
glancesã¯è²ã
ãªæ
å ±ã表示ã§ããã¢ãã¿ãªã³ã°ãã¼ã«ã
ã¤ã³ã¹ãã¼ã«
pipã§ã¤ã³ã¹ãã¼ã«ã§ããã®ã§ä¸è¨ã³ãã³ããå®è¡ã
$ pip install glances
使ãæ¹
glances
ã§èµ·åã§ãããå³ã®ããã«è²ã
ãªæ
å ±ãã¾ã¨ãã¦è¡¨ç¤ºå¯è½ã
ãã©ã¦ã¶ã§ç¢ºèªã§ããWebãµã¼ãã¢ã¼ããããªã¢ã¼ããã·ã³ãç£è¦ããã¯ã©ã¤ã¢ã³ãï¼ãµã¼ãã¢ã¼ããããããã ã
ctop
ctopï¼å ¬å¼ãã¼ã¸ï¼
ctopã¯ã³ã³ããç¨ã®ã¢ãã¿ãªã³ã°ãã¼ã«ã
ã¤ã³ã¹ãã¼ã«
Linuxã®å ´åã¯ãã¤ããªããã¦ã³ãã¼ãããã
$ sudo wget https://github.com/bcicen/ctop/releases/download/v0.6.0/ctop-0.6.0-linux-amd64 -O /usr/local/bin/ctop $ sudo chmod +x /usr/local/bin/ctop
Macãªãbrewã§ã¤ã³ã¹ãã¼ã«ã§ããã
$ brew install ctop
Dockerã§èµ·åãããã¨ãã§ããã
$ docker run --rm -ti \ --name=ctop \ -v /var/run/docker.sock:/var/run/docker.sock \ quay.io/vektorlab/ctop:latest
使ãæ¹
ctop
ã§èµ·åã§ããã
h
ã§ãã«ããã¤ã¢ãã°ã表示ãããã¼ãã¤ã³ãã確èªã§ããã
gtop
github.com
gtopã¯èª¬æã«ããã¨ã¿ã¼ããã«åãã®ã·ã¹ãã ã¢ãã¿ãªã³ã°ããã·ã¥ãã¼ãã
ã¤ã³ã¹ãã¼ã«
npmã§ã¤ã³ã¹ãã¼ã«ã§ããã®ã§ä¸è¨ã³ãã³ããå®è¡ã
$ npm install gtop -g
使ãæ¹
gtop
ã§èµ·åã§ããã
p
, c
, m
ãæ¼ãã¨ããã»ã¹IDãCPU使ç¨çãã¡ã¢ãªä½¿ç¨éã§ããã»ã¹ãã½ã¼ãã§ããã
htop
htopã¯èª¬æã«ããã¨ã¤ã³ã¿ã©ã¯ãã£ããªããã»ã¹ãã¥ã¼ã¢ã
ã¤ã³ã¹ãã¼ã«
CentOSã®å ´åã¯ä¸è¨ã³ãã³ããå®è¡ã
$ sudo yum install htop
ãã®ä»ãGitHubãªãã¸ããªã®ã½ã¼ã¹ã³ã¼ããããã«ãããæ¹æ³ãããã
$ ./autogen.sh && ./configure && make
vtop
vtopã¯èª¬æã«ããã¨ã¢ã¯ãã£ããã£ã¢ãã¿ã
ã¤ã³ã¹ãã¼ã«
npmã§ã¤ã³ã¹ãã¼ã«ã§ããã®ã§ä¸è¨ã³ãã³ããå®è¡ã
$ npm install -g vtop
使ãæ¹
vtop
ã§èµ·åã§ããããã¼ãã¤ã³ãã¯å³ã®ä¸é¨ãåç
§ã
cpustat
cpustatã¯çãééã§ãµã³ããªã³ã°ãããã¨ã§è©³ç´°ãªCPU使ç¨ç¶æ³ã確èªã§ãããã¼ã«ã
ã¤ã³ã¹ãã¼ã«
Goã§æ¸ããã¦ããã®ã§ä¸è¨ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ã§ããã
$ go get github.com/uber-common/cpustat
使ãæ¹
cpustat
ã§èµ·åã§ããï¼root権éã§å®è¡ããå¿
è¦ãããï¼ã
$ cpustat This program uses the netlink taskstats inteface, so it must be run as root.
-t
ãªãã·ã§ã³ãæå®ããã¨å³ã®ãããªè¡¨ç¤ºã«ãªãã