glances - a CLI curses-based monitoring tool

Forum rules
General talk about software - if the program is not in the repos, please links to the developer's page or github.
User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

glances - a CLI curses-based monitoring tool

Unread post by stark » Tue Nov 25, 2014 6:07 pm

Well its dirty and a bit slow due to written in python but does what it claims.

https://github.com/nicolargo/glances
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by machinebacon » Wed Nov 26, 2014 2:47 am

In older BBQ releases it was included (until we removed all Python programs). I used to like it :)
..gnutella..

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Thu Nov 27, 2014 3:07 pm

Yeah it would be nice if someone rewrites it in C.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
harveyhunt
Haxxor
Posts: 125
Joined: Mon Jul 07, 2014 3:06 am
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by harveyhunt » Fri Nov 28, 2014 1:57 pm

I like using this tool, but I find that the sensor display is often really buggy - the temperatures don't appear on my laptop, but I can see them through lm-sensors...

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Fri Nov 28, 2014 5:39 pm

Haven't enabled that feature as i prefer for that lm_sensor :) but i'll agree with you that its buggy and the refresh rate and memory usage is not so...good (python to blame ?)
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: glances - a CLI curses-based monitoring tool

Unread post by DebianJoe » Fri Nov 28, 2014 8:13 pm

Not something that I've ever really used (so excuse my ignorance), but if it IS Python to blame, is it running as a script? If so, it's within reason to compile it to a local binary so that you don't have the interpreter working like crazy all the time to provide regular subshells and calls to other tools before going back into interpretive mode. I looked at their git, and it appears to not have included directions for compiling it down, so you might have to do a little groundwork to make it happen, but it would make a huge difference in resource consumption.

This stackoverflow discussion (especially the 2nd answer) provides some interesting light on the depth of Python.

I may be biased (I am, honestly) regarding this subject, but Python is often misrepresented by people trying to make it a more complicated shell-scripting language. To use it for that is like trimming roses with a chainsaw. Sure, it will work for such an application, but it will be nasty, inefficient, and overkill the job.

{edit} While I'm saying that compiling Python will help, don't expect it to be compiled common-lisp or most certainly C levels of performance.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: glances - a CLI curses-based monitoring tool

Unread post by rust collector » Fri Nov 28, 2014 10:47 pm

Image

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by machinebacon » Sat Nov 29, 2014 2:34 pm

^^ We have Clinky anyway :D
..gnutella..

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Sat Nov 29, 2014 4:15 pm

@DebianJoe Thank You for the python suggestion and link :) I'll look into those.I'm guessing this has to be done with the 'py_compile' compile module ?

/usr/bin/glances is a python script containing these lines.

And i ran 'locate glances' (just for the sake of curiosity) which gave me a huge list

And Glances sucks in more than 12mb ram with a cpu consumption around 3-4.5%

And i apologize for anykind of misunderstanding, I didn't mean to bash on python, its powerful and a great language to begin with.And things like high performance is not be to expected from such a language.When i said 'blame python?' i meant that the issue is obvious and not the developer's fault :)
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
harveyhunt
Haxxor
Posts: 125
Joined: Mon Jul 07, 2014 3:06 am
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by harveyhunt » Sat Nov 29, 2014 8:52 pm

stark wrote:@DebianJoe Thank You for the python suggestion and link :) I'll look into those.I'm guessing this has to be done with the 'py_compile' compile module ?

/usr/bin/glances is a python script containing these lines.

And i ran 'locate glances' (just for the sake of curiosity) which gave me a huge list

And Glances sucks in more than 12mb ram with a cpu consumption around 3-4.5%

And i apologize for anykind of misunderstanding, I didn't mean to bash on python, its powerful and a great language to begin with.And things like high performance is not be to expected from such a language.When i said 'blame python?' i meant that the issue is obvious and not the developer's fault :)

The py_compile module merely converts the code into python bytecode (the .pyc files), this means that the interpreter can be started faster (there is no need to compile before interpreting), but doesn't affect execution speed.

The content of /usr/bin/glances is auto generated by python's setuptools module - that file is just acting as a nice wrapper so that there is something in the /usr/bin folder.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: glances - a CLI curses-based monitoring tool

Unread post by DebianJoe » Sat Nov 29, 2014 9:52 pm

^ Hunt's on target. py_compile doesn't actually affect the run-speed beyond startup. The reason I linked the discussion I did is that over the first few answers, there is a lot of clarity provided towards differing branches of Pythonic language. I would simply prefer that you be aware of the specifics before making generalized claims about a banner of languages. Most branches of Python are semi-interpreted, where there are a few forms that are eventually compiled into native machine code.

It also stands to reason that this particular program (group of wrapped scripts, as it sounds) is just a resource hog. As I said, I have never felt a need for it, and thus don't have ANY first-hand experience with it. Take this as a sharing of thoughts, not as an attack on anything you've said.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Sat Nov 29, 2014 10:09 pm

@harveyhunt Hmm, you're definitely right, how about cython ?

@DebianJoe Ofcourse not! I'm always looking forward learning something new and getting rectified when i'm wrong and I always appreciate the details :)

Now, if only i was a good multi-tasker then i would learn more languages at the same time.

The main reason i chose glances because i got tired of opening top/htop,jnettop,iotop and all the info scattered around but now that i think of thats much more resource friendly.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by machinebacon » Sun Nov 30, 2014 3:47 am

^ you could write a wrapper that opens for example:
- a new terminal with tmux
- split once vertical, twice horizontal, with
-- top
-- nettop
-- iotop
-- some gnuit tool[1] ('apt-get install gnuit') maybe?
Would definitely be a bit lighter and teach you a few tricks on how to execute programs in tmux at startup [2] :)

----

[1] info gnuit
The `GNUIT' package contains three interactive programs and a few
additional utilities. Here there is a description of each of them.

* Menu:

* gitfm:: A file system browser.
* gitps:: A process viewer/killer.
* gitview:: An ASCII/HEX file viewer.
* gitkeys:: An utility for displaying key sequences.
* gitwipe:: An utility for wiping files.
* gitmount:: A script for mounting file systems.
* gitaction:: A per file type action script.
* gitunpack:: Unified archive unpacking.
* gitrgrep:: A recursive grep script.
[2] http://uploads.mitechie.com/books/tmux_p1_1.pdf
..gnutella..

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Sun Nov 30, 2014 10:22 am

Thanks mb. its about time i look into tmux's session management.That book is amazing, Thank You :D

Side question: how do you guys multi-task ? As in learning/trying alot of thing at the same time ? There are so many useful wms,editors,programming languages,random softwares.And i suck at mastering even one of them.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by machinebacon » Sun Nov 30, 2014 12:42 pm

Side question hopefully answered from a different POV:
I use tmux 100% of the time in TTY (which is nowadays my session of choice in 80% of the cases), so the multi-tasking will work quite automatically then. One usage example (without running Emacs, which could actually replace everything there) is:

TTY1 - tmux running, split window vertically and once horizontally. On the left you can have your main shell, in the right upper window htop, in the lower window run mpg123 http://some-stream.org &, background it, then start alsamixer. (I need this setup for the netbook that has no volume keys)
TTY2 - xlinks2 http://en.wikipedia.org
TTY3 - your editor of choice

You can then either browse through the TTYs with <alt><left> and <alt><right> (or <alt><f1><f2><f3>) or switch inside of tmux with the keycombo you have in the conf file. I often prefer tmux opening a new 'workspace' with <ctrl+a><c> rather than splitting the window (my screens are comparably small anyway).
Working in the TTY prevents you from copy-pasting (like in GUI environments), because cut/paste is quite different in TTY (it works quite well with middle-mouse click in tmux).
Staying in the TTY helps you to actually type content, not just mark - copy - paste. At least with programming, this is the only way you can really learn something: by typing.

Once you master a week in TTY, your choice of applications and your workflow in X or GUIs will also change. Eventually you end up using Emacs, which leads more or less to programming or tweaking lisp files :D
..gnutella..

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Sun Nov 30, 2014 2:39 pm

I absolutely agree with you :) I spent little time at the tty but i couldn't get mpv to play videos in the framebuffer like mplayer and the biggest downside was the the syntax-highlighting of emacs and vim was limited to linux console's colors which is normal i guess.And i couldn't get emacs's colors to work properly inside urxvt which is the reason i'm now learning vim but i'll get back to emacs (hopefully someday ;) Can fbterm pass this limit or do i need to use some other form of tty ?

By multitasking i meant learning alot of stuff in the same time.

Like Learn: bash,python,c,c++(compulsory) and then there is editors like emacs and vim so maybe a little bit elisp and viml ? And then there is window managers dwm,herbstluftwm,bspwm,etc and maybe some random interesting piece of software.

So thats quite a big list and softwares like emacs and vim takes quite some time ( specially emacs :).Not to mention learning multiple programming languages has a risk of losing sanity (atleast for me).How would you break down this learning curve ?
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: glances - a CLI curses-based monitoring tool

Unread post by DebianJoe » Sun Nov 30, 2014 4:17 pm

Side Question: Point of View #2

I personally play to necessity and weaknesses (which is what I SHOULD be doing right now, rather than playing on a BBS.) If you have to learn C++ for a class or work, then that should be priority #1.

Still, once you understand C++, C isn't too bad, it just has a few more rules about where things can be declared. Once you understand C, then dwm (and many other WM's) will just make sense as they're pure C implementations.

What I mean by 'play to weaknesses', I got stuck in a commit message one time on a computer that had vim as the text editor. After I looked up how to get my message saved, I decided to learn vim. So when I installed BBQ Elektra (gives you a time frame on when I did this), I only had vim as an editor on it. Within a week of working like that, I could get around pretty well. Within a month, I felt pretty confident with it. Then I started switching back and forth between editors again. I still use vim/nano/emacs interchangeably for specific tasks. I learned what basic bash I know by simply not having X-server on a system that I regularly used for a while. If I couldn't figure out how to do something, I simply didn't get it done.

Also, you don't have to learn anything that you don't need. I like Emacs, a lot, but Pidsley, dkeg, and quite a few others around here lead full, productive life without it. I wouldn't expect to 'learn' emacs or vim fully. Learn the basics as you learn something else, and let your knowledge of them organically grow. I've still not learned everything about either of them, and learn things as I have need to know them.

Hope that helps.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Sun Nov 30, 2014 5:13 pm

DebianJoe wrote:
- Play to necessity and weaknesses.

- Learn the basics as you learn something else, and let your knowledge of them organically grow.
Very Well said.I hope i can stick with them.

Unfortunately, i'm learning C++ in borland, don't how much knowledge from that is going to be usable when i decide to learn C++ for practical use.

Both the editors have their use-cases :) But i suppose 'one thing at a time' approach is better.I don't have to learn, its just for curiosity :) but as you said i'll stick with whats necessary and learn the bare basics of the things i'm curious at a time.

Thank You, this definitely helped :D
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: glances - a CLI curses-based monitoring tool

Unread post by simgin » Mon Dec 01, 2014 3:32 pm

^ Actually, thank you for asking these questions Stark, never thought of it.

And thanks DJ and MB for giving these very detailed and logic answers. I will go more minimal from now on and pressure myself a bit more :)

Cheers
simon
Someone told me that I am delusional, I almost fell off my unicorn.

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: glances - a CLI curses-based monitoring tool

Unread post by stark » Mon Dec 01, 2014 6:30 pm

^ http://kmandla.wordpress.com/2010/04/27 ... inimalism/

Grabbed that from DebianJoe's old sig from *somewhere* :D

Oh and don't pressurize yourself relax,maintain focus and practice :)
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

Post Reply