karamTop

Karamba & Superkaramba

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
6.3
Description:

A superkaramba theme that parses /proc. Shows an X number of running processes with CPU, Memory usage and program name, sorted by CPU. The default number of processes to show is 5.

Idea based on the gkrelltop a plugin for GKrellM.
pytop.py is the core class file. It can be used within any kind of script.

Keep in mind since it reads /proc directly, this means it's Linux only. As FreeBSD and possibly other *nixes have a completely different /proc layout.

-----------------
The GUI configuration isn't that great. There isn't much error checking. You can always modify the theme configuration files for fine tuning. Any more options and it just becomes too tedious to code. Right click on Karamtop, Configure Theme:
- Choose Theme
- Whether to hide processes with a cpu percent of 0
- Set the alignment for the command (program name) text
- Set the column order of the output

For theme creaters. The theme layout is designed so you can create a directory inside of the theme directory with the name of your theme. Which will contain the configuration file and images. That way you can tar up everything easily. This won't work with the skz format. I suppose maybe I'll make something that will automatically install themes in tar.gz format at some point.

-----------------
Designed to work with my theme, MiniKaramba.
http://www.kde-look.org/content/show.php?content=27802

A karamtop theme with an alternative background: http://www.kde-look.org/content/show.php?content=25626
Work like this is encouraged. Thanks.
Last changelog:

14 years ago

0.45
--------------
- Sometimes karamtop/superkaramba would run for weeks without crashing and other times it would crash relatively soon. Now karamtop defaults with threading off, but supports turning it back on through the config.

0.44a
--------------
- Fixed compatibility issues with Python 2.3 (thanks to somebody emailing me and reporting the problem)

0.44
--------------
- Really fixed crashing issues. I simplified the threading engine a lot more.
- Added in support for a better sorting module new in Python 2.4. If you don't have Python 2.4 it should catch this and use the previous method. I do not have any machines with Python 2.3. So, I'm not sure if this works. Please let me know if there are problems.

0.43
--------------
- Fixed a problem where the proc thread would sometimes die if superkaramba locked for a long enough time. Basically it would stop updating. Specifally when liquid weather updates.

0.42
--------------
- Had another bug causing random periodic crashes. Tested it for about 5 days straight on one of my systems.

0.41
--------------
- Improved code for running multiple instances.
- When memory for a process is 0 don't put 'k' after it.

0.40
--------------
- Supports running multiple instances
- Added AeroG theme

0.39
--------------
Sorry for a new version so quick, but I left out a number of things.
- Added GUI option to configure the command (program name) alignment
- Which led to modifying the theme config files. In the future. I will try not to make changes that require modification of the theme config files.
- During testing some changes were made to the look of flatgray. I forgot to change things back for the last release. Mostly minor changes.

0.38
--------------
***Major changes***
Redid the main interface. Now allows for themes. See inside the themes directory
Provides GUI options to configure:
- The theme (currently flatgray and TDE)
- Whether to hide processes with a cpu percent of 0 (overrides theme settings)
- The order of the output (overrides theme settings)

0.37
--------------
(internal release)
Complete redesign of the engine. Simpler and more efficient

VgnFrnd

11 years ago

Thanks for karamtop. It does exactly what I need, as my karamba system monitor of choice does not include process information. (In my opinion, system monitors that do display system processes are bloated with a bunch of other stuff I don't need).

I wonder why more designers of "slim" system monitors aren't incorporating your code into their monitors? Alternatively, I wonder if you might modify some of the other system monitors to include your code, effectively "karamtopping" them?

Regardless of what happens next, thank you for a writing such a nifty piece of code.

Report

HavinItAgain

11 years ago

Hi, thanks for this theme. I've used it nearly a year and it's perfect ;)

I have a small question. I want to re-position the theme to the bottom-right corner of my desktop, but whenever I reload it (or restart my desktop session) it jumps about 200px up/left. Is there a way I can make it stay put?

Report

rdoggsv

13 years ago

nice theme , its working great :D

Report

sango

13 years ago

I'm a little bit confused. I try to understand how pytop.py works to modify it for my usage.

Now i found the attribute self.pcpu which is set in __init__ and in self.totalCPU(), but is'nt use a any place. So, what do self.pcpu? And where is it used?

Report

C

moloch

13 years ago

self.pcpu is used on line 123 in version 0.44 within the totalCPU method. It holds the total cpu usage as a percentage.

Report

sango

13 years ago

Yes, self.pcpu is set there, but nothing more. I can't find any place where this var is used. So, for what reason is this there? From where is this var called?

Report

C

moloch

13 years ago

Oh, I see. No it has no real use as far as karamtop is concered. When I first coded it I had it computing that just to make sure everything was working. I just left it in as it could be a variable somebody may want to use down road. The simple math doesn't really affect CPU usage. Maybe I should comment it out, though.

BTW, if you make any improvements, I'd be interested in seeing them.

Report

kovidgoyal

13 years ago

You can actually get this output really easily from ps
ps -eo comm,pcpu,pmem --sort -pcpu | head -n7

Report

C

moloch

13 years ago

The problem is ps only displays the total cpu time for each process. Rather than what the process is doing that moment. So I would have to run ps twice and to get an reading for that moment.

Thanks for the comment though.

Report

kovidgoyal

13 years ago

Umm according to the ps man page pcpu gives the %CPU usage. More precisely, the cpu time/real time. You can see an example of its use if you download my ps plugin for Aero AIO.

Report

C

moloch

13 years ago

Oops, you're right I was looking at the memory percentage number thinking it was the cpu usage.

Thanks for the command, I may try playing around with using it.

Report

C

moloch

13 years ago

Actually I take that back. When I was taking a closer look I noticed this. Take something like firefox. Firefox does use a lot of CPU usage while browsing but it's CPU usage goes down to nearly 0 when idle. Confirm this with top. However it's average CPU time, since it was first started, maybe somewhere around 5-10%. This is what ps reports.

Basically to see this. Take some application and generate a bunch of CPU usage with it. Leave it idle and compare the output of ps with the output of top. They differ by a lot, atleast with me. You also notice the opposite. Make the application generate a bunch of CPU usage, while doing so. Look at top. It should spike to 99%. Since ps is taking the average. CPU usage will rise gradually while the applicaton sustains high CPU usage.

Report

sango

13 years ago

Why use this project a seperate python-class to read out /proc, instead of only call top and parse the output?

Report

C

moloch

13 years ago

One issue, I just didn't like the idea of running Top every 2 or 3 seconds.

That was only a cover for my real motivation. Which was that I really love Python and wanted to do something that would get me familiar with creating classes. As an old Perl programmer my OO concepts weren't that great. When I had slight pauses in superkaramba during updates. I figured why not complicate things more and learn threading. The reality is parsing /proc managed to save about 1% cpu usage on my slowest machines and negligible on my fastest machine.

That's all karamTop is to me. A big learning project. I put it here so others can benefit from it.

Report

soxofaan

13 years ago

That's what I tried in TopMon:
http://www.kde-look.org/content/show.php?content=21482
My approach seems to have some problems with shared memory and percentages not adding up to 100%.
I think karamTop can inherently do a better job.

Report

elessar

13 years ago

Hello,

Anybody knows why I can't execute this theme together with ZyzSysmon or karamtop? after working 5 min, a new instance of superkaramba starts and my themes become frozen. Is there any incompatibility with both themes?

Thank you very much

Report

C

moloch

13 years ago

Are you referring to ZuzuSysmon? http://www.kde-look.org/content/show.php?content=30350

It appears he is using my theme. There is an issue with running more than one instance of karamtop at the same time. If you are using his theme, then there is no need to use mine at the same time.

I'll look into allowing more than one instance, in the meantime I will release something that at least gives an error message rather than causing superkaramba to completely freeze.

Report

amdecko

13 years ago

Super! :)

Report

sango

13 years ago

I can't download the theme??

Report

C

moloch

13 years ago

Which file are you having a problem with? They both seem to work. However the one in skz format is on my home webserver. It's on a non-standard port 81 and some firewalls (especially schools) block that.

Report

sango

13 years ago

By all files, there come the message "Not found". I have no firewall or some other thing which could brake the link.

Report

C

moloch

13 years ago

Looking at my logs I realised that I forgot to change the link for karamtop-0.38.skz. So some people downloaded the previous release. Fixed now.

However I can't at all figure out why you would be having issues. Maybe it's a problem with kde-look. Here are direct links to both the files on my server.

http://jeffg.dnsalias.com:81/software/karamtop-0.38.tar.gz
http://jeffg.dnsalias.com:81/software/karamtop-0.38.skz

Report

sango

13 years ago

Thanks, the directlink works :)

After all, the KDE-Look-Link don't work, but i found out that i should be a problem of my browser. I use Opera, which have the problem. But with Konqueror, it load without problems :-?

Report

solanum

13 years ago

Yeah, actually. I like the TDE style, being a bit bigger suits a high res monitor too. Any chance of getting it back and being able to choose between TDE and the new style?

Report

C

moloch

13 years ago

ok, just load karamtop.TDE.theme

Report

14 years ago

0.45
--------------
- Sometimes karamtop/superkaramba would run for weeks without crashing and other times it would crash relatively soon. Now karamtop defaults with threading off, but supports turning it back on through the config.

0.44a
--------------
- Fixed compatibility issues with Python 2.3 (thanks to somebody emailing me and reporting the problem)

0.44
--------------
- Really fixed crashing issues. I simplified the threading engine a lot more.
- Added in support for a better sorting module new in Python 2.4. If you don't have Python 2.4 it should catch this and use the previous method. I do not have any machines with Python 2.3. So, I'm not sure if this works. Please let me know if there are problems.

0.43
--------------
- Fixed a problem where the proc thread would sometimes die if superkaramba locked for a long enough time. Basically it would stop updating. Specifally when liquid weather updates.

0.42
--------------
- Had another bug causing random periodic crashes. Tested it for about 5 days straight on one of my systems.

0.41
--------------
- Improved code for running multiple instances.
- When memory for a process is 0 don't put 'k' after it.

0.40
--------------
- Supports running multiple instances
- Added AeroG theme

0.39
--------------
Sorry for a new version so quick, but I left out a number of things.
- Added GUI option to configure the command (program name) alignment
- Which led to modifying the theme config files. In the future. I will try not to make changes that require modification of the theme config files.
- During testing some changes were made to the look of flatgray. I forgot to change things back for the last release. Mostly minor changes.

0.38
--------------
***Major changes***
Redid the main interface. Now allows for themes. See inside the themes directory
Provides GUI options to configure:
- The theme (currently flatgray and TDE)
- Whether to hide processes with a cpu percent of 0 (overrides theme settings)
- The order of the output (overrides theme settings)

0.37
--------------
(internal release)
Complete redesign of the engine. Simpler and more efficient

12345678910
product-maker Count:142 Rating: 6.30
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
0.45
updated Mar 03 2006
added Jun 06 2004
downloads today
0
page views today 3