Live data from Hacker News

Glances - an easy CLI overview of your system (CPU, mem, I/O)

nicolargo.github.com

11–20 of 59 posts

Re: Glances - an easy CLI overview of your system (CPU, mem, I/O)

#12

Just curious, is Glances the python script taking up 100% CPU and 1 GB of RAM in that screenshot?

Doubtful. I have glances running on a server at home updating on the default 1s timer, it uses 5% CPU. I should probably change that to a longer update interval, but that server doesn't do much processing so it's not a big problem.

You can also launch glances.py directly so if it is going to show up on the process list it will be as 'glances.py' and not just 'python'.

Re: Glances - an easy CLI overview of your system (CPU, mem, I/O)

#17

Seems to run decently on my Mac 10.8

Could you share how you got this to work on your Mac?

  % wget https://github.com/downloads/nicolargo/glances/glances-1.4.tar.gz
  % tar zxvf glances-1.4.tar.gz
  % cd glances-1.4
  % sudo python setup.py install

Re: Glances - an easy CLI overview of your system (CPU, mem, I/O)

#18

Seems to run decently on my Mac 10.8

Could you share how you got this to work on your Mac?

I got this working by just installing pip and then entering "sudo pip install glances".

I have to say, I think this will replace htop for me on my mac. It's actually more useful than Activity Monitor is since it also shows network interfaces.

Re: Glances - an easy CLI overview of your system (CPU, mem, I/O)

#20
The app looks really nice visually, a few points though:

except Exception: pass

is generally considered to be a code smell. The problem being that when you're catching all exception information and throwing it away you will never know what went wrong and where. If you're doing a try/except Exception nested inside another except Exception then I would humbly suggest that you really need to think about refactoring and restructuring.

Also, anywhere that you see a repeating pattern, you might be better off wrapping it in a function or method rather than typing it out each time. For example in your __update__ method starting at about line 400 you've got pretty much the same code in two places with just a variable different between the two.

Post reply on HN