Coder Social home page Coder Social logo

vtop's Introduction

vtop

Greenkeeper badge Build Status

A graphical activity monitor for the command line.

How to install

If you haven't already got Node.js, then go get it.

npm install -g vtop

If you're on macOS, or get an error about file permissions, you may need to do sudo npm install -g vtop. Don't do this if you're using nvm.

Running

This is pretty simple too.

vtop

If you really like vtop, but your finger muscle memory means you keep typing 'top' then why not add an alias to ~/.bashrc.

alias top="vtop"
alias oldtop="/usr/bin/top"

Keyboard shortcuts

  • Press 'u' to update to the latest version of vtop.
  • Arrow up or k to move up the process list.
  • Arrow down or j to move down.
  • Arrow left or h to zoom the graphs in.
  • Arrow right or l to zoom the graphs out.
  • g to go to the top of the process list.
  • G to move to the end of the list.
  • dd to kill all the processes in that group

Mouse control

If your terminal supports mouse events (like iTerm) then you can click on the items in the process list. As well as use the scroll wheel. You can disable mouse control with the vtop --no-mouse option.

FAQs

How does it work?

It uses drawille to draw CPU and Memory charts with Unicode braille characters, helping you visualize spikes. We also group processes with the same name together.

I think the CPU % is coming out wrong.

We calculate the CPU percentage as a total of your overall system power. 100% is all cores and HyperThreads maxed out. This is different to how Apple Activity monitor works.

Can I change the color scheme?

Sure, just do:

vtop --theme wizard

This loads the theme file in themes/ with the same name. Make your own and send me a Pull Request :)

You could add this to your aliases if you'd like to use it always.

alias vtop="vtop --theme brew"

What about measuring server req/s, log entries, etc etc?

Yeah that's on the list :) Feel free to send a pull request though. Check out the sensors/ folder.

What license is this under?

MIT – do what you like with it :)

Contributing

Get stuck in – click the fork button, then clone to your local machine. Use the GitHub Desktop client if you don't know Git. Tinker with the code then run this from the command line:

./bin/vtop.js

When you push it'll run the Standard JS checker http://standardjs.com/. If you run 'npm test' in your own terminal too, this runs in Travis, your PR will fail the test if this command fails.

Standard - JavaScript Style Guide

vtop's People

Contributors

alyssais avatar amilajack avatar asheriif avatar birkhofflee avatar d-oliveros avatar decanus avatar dictummortuum avatar franklinjavier avatar geomaster avatar greenkeeper[bot] avatar greenkeeperio-bot avatar ianjsikes avatar ivanbrennan avatar jamesrwhite avatar keeev avatar lefoy avatar madbence avatar mauladen avatar mdh34 avatar mrrio avatar patrickocoffeyo avatar pfych avatar tiimgreen avatar valentinklinghammer avatar vkarampinis avatar williamboman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vtop's Issues

Mouse LXTerminal

I'm using LXTerminal from LXQt to ssh into my box and run vtop.

The moment I move my mouse over the running vtop session (which otherwise works perfectly) it seems random keyboard presses are sent through somehow ... Suddenly and very quickly. The whole thing eventually crashes when I suppose pressing "u" is somehow simulated ...

Any ideas ?

updating/theme issue?

how do i check which version I'm on? i pressed u to update, and the update seems to work, but it doesn't have the monokai theme, which leads me to believe it's an old version.

Resizing window bug

screen shot 2014-06-13 at 15 08 04

Steps to reproduce:

Resize the window horizontally from big to small quickly.

Show pid on process list?

Thinking it would be nice if the pid was displayed next to the name of the process. I'm not what method is being used to generate the list, but @MrRio if that's something you're not opposed to I can send in a PR. Thoughts?

vtop consumes processor's time

hi
first, I want to think you for the project, I find it cool :)
But I have a little problem, I don't if you too have the same problem, vtop uses processor more than htop, as you can see on the picture, 51% vs 3%
screenshot vtop vs htop

"Not a terminal" on Windows with MinTTY

On Windows, while using the MinTTY executable packaged with MSYS2, vtop crashes saying "Not a terminal".
I'm unable to use the default Windows commandline, as it doesn't support the unicode characters needed for graph display.
Here's the full stack info if needed:

C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\node_modules\blessed\lib\program.js:241
    throw new Error('Not a terminal.');
    ^

Error: Not a terminal.
    at Program.listen (C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\node_modules\blessed\lib\program.js:241:11)
    at new Program (C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\node_modules\blessed\lib\program.js:89:8)
    at Function.Program (C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\node_modules\blessed\lib\program.js:28:12)
    at C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\app.js:18:21
    at Object.<anonymous> (C:\Users\matin\AppData\Roaming\npm\node_modules\vtop\app.js:646:2)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

Color and Character Problems Raspberry Pi running Raspbian Debian Distro

This is pretty minor and certainly an edge case, but for fun I have loaded up a Raspberry Pi as a Node.js box. And, of course, I have to have the best 'top' around on it so I installed vtop. However, the colors are all wrong and the border characters are incorrect. Could you point me to where I could tweak these configurations and maybe get it corrected?

img_2356
img_2355
img_2354

Weird CPU chart

bug-vtop

My CPU chart looks shredded (there are wholes in some vertical lines but not always on the same horizontal line) compared to your example with nice lines.

Is it normal ?

I am using Kubuntu 14.04.3 LTS and launched vtop in Konsole.

vtop doesnt play nice with tmux via ssh

vtop seems to be over estimating the size of the tmux pane causing it to cut into other panes please see attached screenshot
screenshot 2016-12-02 at 8 54 46 pm

It seems like it is happening out of tmux as well
screenshot 2016-12-02 at 8 58 58 pm

Crash on OS X 10.11

Hi.

I don't know if I'm doing it wrong or what. But it appears that vtop is crashing when I move my cursor insiden the Terminal window.
I have uploaded a video on YouTube showing the problem.

This is on OS X 10.11.3

Processes listed with over 100% memory usage

Notice php5-fpm is listed as 142% memory usage here:
screen shot 2014-06-12 at 9 38 20 pm

However, this is incorrect as there is no swap in use, and the server is only using 725 MB out of 1024 MB total.

It may be counting shared memory weirdly.

Debian Linux 64-bit.

vtop not in path

I try running vtop after installing it, but I get the 'command not found' error
screen shot 2016-05-20 at 12 41 53

Npm installs older version

Fixed bugs like showing the correct free memory on linux do not appear to be fixed in the version installed from npm.

Ability to set update interval?

I know vtop's aim is to be a steroidal version of (h)top, but it might be nice to be able to set the interval as you can with those (or -d / --delay as they both call it). In (h)top the delay is more so you can absorb the current snapshot of info but in vtop it has the advantage of letting you control what period of time your histogram represents (based on your interval and terminal width).

Being totally greedy, it'd be great if the metrics for the interval were still aggregated every X msec (from a quick scan it looks like 100ms?), so if I set my update interval to be 5 seconds, vtop would still read 50 samples and then just render the average values for that 5 second period.

uid must be an unsigned int (installing , osx 10.11.1 , iterm)

when trying to install vtop on osx with this command sudo npm install -g vtop getting multiple error thats shown below !

npm ERR! uid must be an unsigned int
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "vtop"
npm ERR! node v4.5.0
npm ERR! npm  v3.10.8

Vtop gets crazy as soon as I move the mouse

As soon as I start moving my mouse, vtop quits (probably crashes) and I start to see what looks like the mouse coordinates in ASCII in the terminal input. It sometimes comes back to normal after a few moments, others I have to run reset. This happens on both terminator and xfce4-terminal. I haven't tried anything else.

filter by process

It will be nice to filter by process either in the UI or like vtop --pid $PID

Memory percentage reported as NaN

One of my programs consumes a massive amount of memory. For some reason, this gets reported as "NaN". Furthermore, the leading process character get chopped off of the process name.

screen shot 2014-06-09 at 12 15 56 pm

Option to disable automatic updates

Great work with vtop, I’ve used it on loads of machines in a variety of places.

I’m currently trying to use it on a server’s mission-control style dashboard, however I’m having difficulty running it longterm because autoupdate keeps dropping to a sudo password prompt.

For now I’ve commented out part of the source to disable automatic updating, but it would be great if there was a flag to do this without me hacking around. Maybe vtop --no-update or something?

Wrong width Braille characters cause other text to be pushed off-screen

I'm on a Chromebook using Secure Shell (hterm), and my vtop looks like this:
screenshot 2015-10-06 at 9 50 15 pm
screenshot 2015-10-06 at 9 50 26 pm
screenshot 2015-10-06 at 9 50 40 pm
screenshot 2015-10-06 at 9 50 54 pm

Not sure if the Braille is to narrow or my ASCII characters are too wide, but as the screen fills up it eventually pushes the entire "memory" column off the screen. Resizing the text does not fix it.
By default TERM=xterm but setting it to xterm-256color makes no difference.

List of themes only works if vtop is called from vtop project directory

Steps to reproduce:

rio ~/Projects/vtop (master)
$ vtop --help

  Usage: vtop [options]

  Options:

    -h, --help              output usage information
    -t, --theme  [name]     set the vtop theme [becca|brew|dark|monokai|parallax|wizard]
    --quit-after [seconds]  Quits vtop after interval
    -V, --version           output the version number

rio ~/Projects/vtop (master)
$ cd ..
rio ~/Projects 
$ vtop --help

  Usage: vtop [options]

  Options:

    -h, --help              output usage information
    -t, --theme  [name]     set the vtop theme []
    --quit-after [seconds]  Quits vtop after interval
    -V, --version           output the version number

rio ~/Projects 

if using nvm don't use sudo

I tried to install using sudo but I'm switching node versions with nvm. So if you are running nvm don't use sudo and it will install.

Add flexible layouts

layout.json:
Something like:

[ ['cpu', 'memory'], ['process'] ] # Two rows, cpu and memory at the top, process list at the bottom

Then ability to pass in layout

vtop --layout "['cpu']" # Just a big CPU chart

Multi monitor issue

Hello,

I've got a multi monitor setup in which one monitor is smaller than the other.

If vtop is opened in the bigger one and the mouse cursor goes off the smaller monitor bounds, vtop quits.

Cheers

Should memory only display the used memory?

The memory graph displays the total memory - used memory plus cached and buffered memory. I think the graph should display only the used memory or two/three graphs for the buffered memory aswell.

Due to the use of os-utils, we need to go down one level of abstraction and modify the code used by os-utils..

exports.freeCommand = function(callback){

    // Only Linux
    require('child_process').exec('free -m', function(error, stdout, stderr) {

       var lines = stdout.split("\n");


       var str_mem_info = lines[1].replace( /[\s\n\r]+/g,' ');

       var mem_info = str_mem_info.split(' ')

       total_mem    = parseFloat(mem_info[1])
       free_mem     = parseFloat(mem_info[3])
       buffers_mem  = parseFloat(mem_info[5])
       cached_mem   = parseFloat(mem_info[6])

       used_mem = total_mem - (free_mem + buffers_mem + cached_mem)

       callback(used_mem -2);
    });
}

vtop dies a silent death

This pertains to vtop not launching and instead returning to shell without a peep.

Thank you very much for helping out. I'm more a n00b than I would like to be so I appreciate the patience.

$nodejs -v
v0.10.25

$lsb_release -a
No LSB modules are available.
Distributer ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty

Per your request, 'export' output below:

ptdecker@ptdecker-Satellite-L55-A:~$ export
declare -x CLUTTER_IM_MODULE="xim"
declare -x COLORTERM="gnome-terminal"
declare -x COMPIZ_BIN_PATH="/usr/bin/"
declare -x COMPIZ_CONFIG_PROFILE="ubuntu"
declare -x COMP_WORDBREAKS="
"'><;|&(:"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-JexEHW5ZRs"
declare -x DEFAULTS_PATH="/usr/share/gconf/ubuntu.default.path"
declare -x DESKTOP_SESSION="ubuntu"
declare -x DISPLAY=":0"
declare -x GDMSESSION="ubuntu"
declare -x GDM_LANG="en_US"
declare -x GNOME_DESKTOP_SESSION_ID="this-is-deprecated"
declare -x GNOME_KEYRING_CONTROL="/run/user/1000/keyring-Y34XBy"
declare -x GNOME_KEYRING_PID="1779"
declare -x GPG_AGENT_INFO="/run/user/1000/keyring-Y34XBy/gpg:0:1"
declare -x GTK_IM_MODULE="ibus"
declare -x GTK_MODULES="overlay-scrollbar:unity-gtk-module"
declare -x HOME="/home/ptdecker"
declare -x IM_CONFIG_PHASE="1"
declare -x INSTANCE=""
declare -x JOB="dbus"
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="ptdecker"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arj=01;31:.taz=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lz=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga=00;36:.spx=00;36:.xspf=00;36:"
declare -x MANDATORY_PATH="/usr/share/gconf/ubuntu.mandatory.path"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
declare -x PWD="/home/ptdecker"
declare -x QT4_IM_MODULE="xim"
declare -x QT_IM_MODULE="ibus"
declare -x QT_QPA_PLATFORMTHEME="appmenu-qt5"
declare -x SELINUX_INIT="YES"
declare -x SESSION="ubuntu"
declare -x SESSIONTYPE="gnome-session"
declare -x SESSION_MANAGER="local/ptdecker-Satellite-L55-A:@/tmp/.ICE-unix/1925,unix/ptdecker-Satellite-L55-A:/tmp/.ICE-unix/1925"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AGENT_LAUNCHER="upstart"
declare -x SSH_AGENT_PID="1860"
declare -x SSH_AUTH_SOCK="/run/user/1000/keyring-Y34XBy/ssh"
declare -x TERM="xterm"
declare -x TEXTDOMAIN="im-config"
declare -x TEXTDOMAINDIR="/usr/share/locale/"
declare -x UBUNTU_MENUPROXY="1"
declare -x UPSTART_SESSION="unix:abstract=/com/ubuntu/upstart-session/1000/1781"
declare -x USER="ptdecker"
declare -x VTE_VERSION="3409"
declare -x WINDOWID="27262987"
declare -x XAUTHORITY="/home/ptdecker/.Xauthority"
declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg"
declare -x XDG_CURRENT_DESKTOP="Unity"
declare -x XDG_DATA_DIRS="/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/"
declare -x XDG_GREETER_DATA_DIR="/var/lib/lightdm-data/ptdecker"
declare -x XDG_MENU_PREFIX="gnome-"
declare -x XDG_RUNTIME_DIR="/run/user/1000"
declare -x XDG_SEAT="seat0"
declare -x XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
declare -x XDG_SESSION_ID="c2"
declare -x XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session0"
declare -x XDG_VTNR="7"
declare -x XMODIFIERS="@im=ibus"

License

"MIT- do what you like with it :)"

If the purpose of this is that you can "do what you like with it :)", wouldn't it be better to use a more permissive license, like CC0?

dont update with sudo

most installs will install globally just fine without it

here's what just happened to me:

  1. npm update -g
  2. explodes due to vtop being owned by root (previous update)
  3. npm command is now broken
  4. all global modules broken

had to reinstall node and npm and wipe out /usr/local/lib/node_modules to fix this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.