BusyTasks

Plasma 4 Extensions

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

4
7 .9
Description:

This plasmoid uses several integrated backends to receive its input. Please read at least section REQUIREMENTS before installation.
Moreover, I'd be very grateful for any kind of feedback.


UPDATE
14.0: Holds the new configuration interface and supports synchronised plasmoid instances on multiple workspaces
14.1: Timeout for network notification messages.
14.2: Optional Irix mode, 64-bit support, many optimizations concerning the on-click-function and the panel mode
14.3: Additional configuration file for procps-ng
DOCUMENTATION:
Isn't everything some kind of process? At least on a computer it is. So let's keep an eye on them.
This plasmoid initially was a clumsy spin-off from Dmitry Makovey's tail plasmoid, but after I got more and more used to python and the program got more and more complex I cut everything superfluous and eventually separated it from tail.
This plasmoid uses several programs to get its input. The collected data is neither unique nor new, but the idea to clearly sum it up in one single program is. This task monitor displays up to four different tasks, each with different priority.

CPU intensive task:
Name and the percentage of the most CPU intensive task. The underlying top daemon is very efficient and does not really affect CPU, it is piped to shared memory.
Used backend: http://linux.die.net/man/1/top

Memory intensive task:
Name of the most memory intensive task, combined with a measure of size (absolute value or percentage to total available memory).
The implementation is the same as for the task above.

IO intensive task:
The task (or one of its threads) that currently triggers most IO.
The software package includes an own version of iotop that sends data via shared memory.
Original version: http://guichaz.free.fr/iotop/

NET intensive task:
The task that eats up your bandwidth.
You will be prompted for an administrator password when starting nethogs.
Like the one of iotop, this is a modified nethogs daemon that uses IPC.
Original version: http://nethogs.sourceforge.net

Additionally, the configurable update interval plays a crucial role in resource consumption. The smaller it is set, the more resources are needed.
There should be slightly less resource consumption (in terms of IO as well as overall) since release 8.0. Release 10.0 eventually cut out all IO.

The plasmoid is highly configurable to fit most desktop designs.
It supports highlighting of processes, either through a simple colour change after a certain limit of per cents or via colour gradient. For the statisticians among you, you can even log output. BusyTasks is only useful if it is always visible (e.g. residing on a panel) If you'd have got to minize windows or show the desktop to have a glance on it you could equally start the system monitor.

REQUIREMENTS: (and installation instructions)
The program was tested under several different distributions and is considered stable.(read below). Some of the used daemons may require additional libraries, however.
For full functionality, you need to meet the following requirements:
Installation of top in your command-line interpeter. This usually is the case on UNIX OSs.Proper value of $HOME variable in the shell environment. Verify with "echo $HOME".Python version 2.
On new systems version 3 may only be installed. Use the bash command "python -V" to check your version, additionally you may verify the installation of python2 by entering "python2 -V". Usually it's easy to get previous releases, they are not interferingThe System V IPC module for python.
If you don't have it yet, visit http://semanchuk.com/philip/sysv_ipc/ for download and install instructions.
Short manual:
Download file, go to the related directory and run "sudo python setup.py install". For systems linking python 3 per default, type "sudo python2 setup.py install". If it quits moaning about a python file install the package "python-dev(el)" first. Eventually restart KDELibraries for iotop and nethogs, whose scripts/binaries are integrated in the plasmoid package. There is a slight chance that one of them does not work due to missing libraries. In this rare case, there are basically two ways to proceed: Either install the standalone versions of iotop and nethogs and benefit from automatic dependency resolution or get the missing files/packages manually. BusyTasks usually reports the problem. (read section "troubleshooting")On 64-bit architectures you need to install the 32-bit libraries
TROUBLESHOOTING:
Oddly enough, inside a panel configuration was not possible in KDE prior to version 4.8. You had to drag it out, change settings there and redrag it into the panel.If you have a problem with resizing, activate the option "resize manually"On systems with linux kernel 3.1 (or above), iotop must be run in administration mode. Before activation, make sure there's a permissions error with standard rights. Be careful, arbitrarily switching between user and administration mode may cause an IPC permission error!If the iotop daemon does not start, some libraries may be missing. (see plasmoid output) Install them via KPackageKit, pacman, portage, etc.If none of the implemented nethogs daemons run, make sure you have the required libraries (libpcap). If it still doesn't work, download the sources (see links), compile it directly on your system, copy it to the BusyTasks directory and overwrite one of the existing nethogs0* daemons.If the name resolution of VirtualBox virtual machines does not work and you see some weird symbols, close the plasmoid, delete the current bashpipetosharedmemory75* binaries from the contents folder and use the old ones by removing the *.old endings. Additionally, they must be executable.On some systems the superuser frontend does only accept passwords entered in terminals. As a consequence the "use administrative password"-setting does not work, you've to manually enter your password each time. As a workaround, one may handle the daemons in the appropriate system runlevel.If the iotop and nethogs daemon do not start, be sure to have entered the correct password.
Iotop may dump a misleading curses error: "_curses.error: setupterm: could not find terminal"If you still don't get it to work, contact me here or via mail. You probably found a bug/compatibility problem.

BUGS:
Since release 12.5 the program should be nearly bug free.
Please report here or via mail (see plasmoid info) if your plasma-desktop crashes (so that I can at least remove the above claim), which usually happens when BusyTasks is removed from the desktop.
Known severe bugs:
None

Bugs occurring too rarely to be easily classified:
1. Nethogs transfer statistics obviously arbitrarily resets at low transfer rates (further examination/observation necessary)
2. VirtualBox name resolution does not work in rare cases (i.e. starting Windows XP before Unix, further examination/observation necessary)
3. The format of the data string provided by nethogs does not always meet the requirements for the plasmoid.

PERFORMANCE:
Python may be the wrong language to write such a tool in.
However, plasma-desktop does not seem to be affected by the plasmoid. On a thirteen years old (!) PIV 1.8GHz the most cpu-intensive plasmoid part is one of its daemons: iotop with 10% cpu load on average, which is quite good for a computer that takes 5-10 min to start up. Given the fact that iotop itself is written in python I even expect some space for improvement using a faster programming language.
Currently the process of (re)configuration is horribly slow.
On the one hand, bad code is responsible for the speed inefficiency, on the other hand it is my quest for user-convenience and upwards-compatibility that accounts for this behaviour. As jobs of configuration or organisation are usually done only twice per runtime (at startup and at termination) it's still acceptable.
I'll probably rewrite the whole program (including the iotop daemon) in C++ sometime (sometime...what a nice euphemism for never ;-)). For the moment reconfiguration performance remains the only real bug.
Additional note: It seems that there's slightly less CPU utilization since version 12.3 on my system. Could just be a coincidence, though.

TESTS: Program successfully tested on:
Kubuntu 9.10, 11.04, 11.10, 12.04 64-bit
Fedora 15
OpenSUSE 11.4
Arch 2011-08-19
Slackware 13.37
Gentoo 11.2
Mint 12
Sabayon 7

TRANSLATIONS:
If you want to contribute to the project, feel free to unpack the plasmoid-package and read the translation instructions in the contents folder.

Suggestions for further development:
*Implement colour gradient for the data transmission monitors.

I strongly recommend all who have installed a previous version to get an update!
Please comment, rate and criticise.
In the long run I'll have to create a website for documentation because the installation possibilities and configuration options are quite impressive and this description's already uncomfortably large. Due to a severe lack of time reading tooltips is all I suggest for now.
Last changelog:

7 years ago

1.0 Initial release
2.0 Keeping original top configuration, Panel integration
2.1 Minor ajdustment: support for multiple plasmoids
3.0 Highlighting a process passing a certain limit with an individual colour.
4.0 More configuration options (e.g. colour gradient)
4.1 Click on plasmoid opens a list of tasks ordered according to CPU usage.
5.0 Optional display of IO intensive task
5.1 Bugfixes (colour change for IO intensive task, process and rate mismatch)
5.2 Configuration option for on-click-behaviour, tooltips, whatsthis-tips
6.0 Code reorganisation, further configuration options, memory intensive task, file history log..
6.1 Optional horizontal arrangement of the tasks, saving the size
6.2 Optional font background to avoid unreadable design
7.0 Code cleanup and reorganisation, disassociation with tail, destructor, bugfixes, more configuration options, NET intensive task, etc.
7.1 Direct change of network interface supported.
8.0 Integration of own iotop and nethogs versions, IPC
9.0 Added icons and a panel mode
10.0 No tail involvement any more (only IPC), bugfixes
10.1 No blocking of plasma-desktop on startup with NET intensive task any more.
10.2 Correct behaviour on systems without user configuration for top.
10.3 Less resource consumption of nethogs, small fix concerning the configuration dialog
10.4 Added a logo
10.5 German and French translations
10.6 Further fixes of bugs (concerning units and logfile) that occurred during code reorganisation.
10.7 Bugfixes: kdesu as optional superuser trigger (for nethogs), updated library link for nethogs
10.8 Implemented several nethogs daemons compiled with different libraries/libary links, debug information
10.9 Small modification for systems with python version 3.
11.0 Easy network interface switching and advanced control over nethogs.
11.1 The last observed unchanged value for a task is displayed for an additional second if the plasmoid is updated once per second.
11.2 Integration of VirtualBox virtual machine name resolution.
11.3 Optional display of the processor that the monitored process is assigned to.
11.4 Improved error handling (at runtime and for plasmoidviewer).
11.5 Extirpation of crashes, performance optimisations, more configuration options
11.6 Iotop bug fix assuring that the task with most IO is chosen.
11.7 Support for newer kernels that deny access to IO statistics for regular users.
11.8 Improved configuration interface, bug fix concerning password prompt
11.9 Small changes to handle high update rate in panels.
12.0 Highlight change in memory amount between update intervals
12.1 Improved panel layout
12.2 Fixed VirtualBox name resolution
12.3 Major update including changes in iotop, nethogs and BusyTasks to enable advanced data collection.
12.4 Extended reset interval concerning the transfer statistics, separate colouring for sum and transfer rate.
12.5 Support for gigabyte values
12.6 Fixed iotop shared memory attachment
12.7 Bugfix concerning encoding of iotop string
12.8 Several minor optimisations (iotop, daemon organisation)
14.0 New internal configuration interface (compatibility upgrade), support for multiple workspaces
14.1 | 12.9 Timeout for network notification messages.
14.2 | 13.0 Optional Irix mode, 64-bit support, many optimizations concerning the on-click-function and the panel mode
14.3 Support for procps-ng (other configuration file)

chepioq

9 years ago

Ok, it's my mistake, I install System V IPC module for python and that work... (I re-installed my Fedora two days ago and I forget install this)

Sorry...

Report

C

unknownSpirit

9 years ago

"since release 9.0"
Sorry, I was referring to release 8.0.

Report

chepioq

9 years ago

I test your plasmoid, when I launch it the size is 30x60.

If i want re-size (60x120), I click on OK button and close the windows setting, but BusyTasks don't grows but is smaller (I think 6x12...).

I use Fedora with KDE 4.7.

Report

chepioq

9 years ago

I launch BusyTasks on my desktop, stanalone.
When I install with plasmapkg -i BusyTasks.plasmoid I have an error :

[dominique@localhost Téléchargements]$ plasmapkg -i BusyTasks.plasmoid
plasmapkg(6951)/libplasma Plasma::PackageStructurePrivate::createPackageMetadata: No metadata file in the package, expected it at: "/tmp/kde-dominique/plasmapkgS1G4J1//metadata.desktop"
Installation réussie de /home/dominique/Téléchargements/BusyTasks.plasmoid

but the plasmoid work.

with plasmoidviewer I have error :

[dominique@localhost Téléchargements]$ plasmoidviewer BusyTasks
Error reading configuration!
Error reading configuration!
Error reading configuration!


I have no problems to re-size fonts or start deamons

Report

C

unknownSpirit

9 years ago

And thanks for your offer to help, I think I'll come back to it later.

Report

C

unknownSpirit

9 years ago

Glad it works now.
The plasmoid is not finished yet, I currently work on the next release with icons. Having least priority language support is still a nice feature that may be included when everything else is done.

Report

C

unknownSpirit

9 years ago

This is partly what I expected. The plasmoid size is saved in the configuration, which obviously is not read correctly.
This is a modified version without error handling. Please run it with plasmoidviewer and report output.
http://www.unet.univie.ac.at/~a0647161/BusyTasksmodified.plasmoid

Report

chepioq

9 years ago

I test your BusyTasks modified, but that don't work.

Output of plasmoidviewer BusyTasks :

[dominique@localhost ~]$ plasmoidviewer BusyTasks
Traceback (most recent call last):
File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 75, in init
self.pyapplet.init()
File "/home/dominique/.kde/share/apps/plasma/plasmoids/BusyTasks/contents/code/main.py", line 111, in init
self.readConfig()
File "/home/dominique/.kde/share/apps/plasma/plasmoids/BusyTasks/contents/code/main.py", line 147, in readConfig
self.height=int(self.config('MCPU').readEntry('height'))
ValueError: invalid literal for int() with base 10: ''
Exception RuntimeError: 'underlying C/C++ object has been deleted' in <bound method BusyTasks.__del__ of <applet_BusyTasks.main.BusyTasks object at 0x13dcd40>> ignored
[dominique@localhost ~]$

This last line

Exception RuntimeError: 'underlying C/C++ object has been deleted' in <bound method BusyTasks.__del__ of <applet_Busy

is when I close plasmoidviewer window.

Report

C

unknownSpirit

9 years ago

I must admit I got ahead of myself, the target goal of this version might have been missed.
If resizing really is your only problem with the plasmoid (what I can't imagine though), this version should work:
http://www.unet.univie.ac.at/~a0647161/BusyTasksmodified.plasmoid

Report

C

unknownSpirit

9 years ago

You've got to resize manually via the plasmoid interface now!

Report

chepioq

9 years ago

Thank...
That work fo me now...
I can re-size plasmoid.

I have another request

I see your plasmoid setting is not internationalized.
For test, I make that and that work for me, I translate some words and there are in french in setting.

For that I use a script python, made by mjmccans for gmail.plasmoid ( http://kde-look.org/content/show.php/gmail-plasmoid?content=101229 )

If you want, send me your email by private message and I send you a BusyTasks with internationalization.

I think you should contact mjmccans to ask if you can use the script.



Report

C

unknownSpirit

9 years ago

Thank you very much for you feedback. As I run a pretty old KDE (version 4.3) I already expected compatibility problems with actual releases.
I am motivated to solve this, though.
If you are using it in a panel:
The first reason I can think of is a panel bug that I have here too: inside a panel, the plasmoid cannot be configured. The solution is quite simple: drag it to the desktop, configure it there and then redrag it to the panel.
If you are using it standalone:
Please tell me if the size problem is the only one (e.g. does the font size change, do the daemons start, etc.)
Last but not least, run it with plasmoidviewer and print the output here.

You may wonder why the plasmoid saves its size independently from plasma. Well, this is related to a plasma bug that keeps size only for a single session. My approach is just a workaround.
If the new KDE does not have this problem any more, I will remove this option.

Report

C

unknownSpirit

9 years ago

On my computer the initial plasmoid-specific top configuration of the daemon is broken in rare cases. Example given: after a restart of plasma-desktop the plasmoid shows a line of my own top configuration.
As there are no complaints about bugs (I can't really believe there are none) I post an explicit request for feedback: did you encounter that bug too?

Report

C

unknownSpirit

9 years ago

I still do not know the cause for this problem.
Nonetheless, for all interested, I wanna state that there will be a major update (first stable release) tomorrow with workarounds and bug fixes.

Report

9

H00K

9 years ago

Sounds brilliant and just what I'd want (instead of having an 'htop' open in Konsole all the time)! :D

...what I wonder though is does it have any impact on resources, tailing top and iotop all the time? I'm talking about having it running all the time on a laptop, where I'd primarily like to have as little as CPU wakeups as possible.

Report

C

unknownSpirit

9 years ago

In the current version only the top daemons write to files. As they work very economically a switch to IPC won't be necessary.

Report

C

unknownSpirit

9 years ago

"Sounds brilliant and just what I'd want (instead of having an 'htop' open in Konsole all the time)! :D"
Depending on how much information you actually wanna see, top or htop in konsole may be a bit oversized. You imagine I wrote this plasmoid because I was not happy with the existing system monitors.

Report

C

unknownSpirit

9 years ago

Hi H00K

"...what I wonder though is does it have any impact on resources, tailing top and iotop all the time? "
This is an interesting question that I've already asked myself. There are two daemons running, writing to 2 files (see knowledge base), which are the source for the plasmoid. I've implemented the daemon mode because starting and stopping the tops periodically is really slow and cpu intensive.
We've to consider cpu as well as IO activity. Top is a highly configurable and mature program that I've set to log only minimum information, that is, what is actually displayed by the plasmoid. On my CPU (Intel Dualcore) the top daemon averagely needs 0.2% when active, so it's really insignificant. Every 3 seconds, it writes about 1 K/s to a file. I've not noticed an impact on plasma-desktop yet.
With iotop, it's a bit more difficult though.
Unfortunately it's not that adjustable and thus logs more information than actually used. This means more effort for the plasmoid to gain data, process and reformat it. On my system the iotop daemon uses about 1.5% cpu, and consumes a bit more IO activity.
For the plasmoid itself, it's not easy to guess its actual effect on the system as it is fully integrated in plasma-desktop's statistics.
I dare to say, however, that I did not recognise significant resource consumption.

"I'm talking about having it running all the time on a laptop, where I'd primarily like to have as little as CPU wakeups as possible."
HTOP consumes about 2% cpu here, so I guess it is in the same league as my daemons.

Kind regards,

Report

9

H00K

9 years ago

That's true. I didn't take into account the resource consumption of 'htop' here. Also, to be honest, Plasma is not really the most resource-friendly thing around.

Hmmm, would it be possible to use some inotify or similar system to track this information?

Report

C

unknownSpirit

9 years ago

"Hmmm, would it be possible to use some inotify or similar system to track this information?"
I think it would.
As the files are updated periodically it would even be enough to just output content regularly. This is actually already the case for iotop's file.

Report

9

H00K

9 years ago

Alright :)

Anyway, using it now and so far I really like it.

It'd be nice if there was some noob-friendly help to the settings.

BTW, have you considered adding a field for MEM usage as well? Sometimes it's nice to spot a memleak before it goes out of control ;)

Report

C

unknownSpirit

9 years ago

"BTW, have you considered adding a field for MEM usage as well? Sometimes it's nice to spot a memleak before it goes out of control ;)"
I did not plan such a feature, but I'll think about it. Memory usage usually is not that quick changing and therefore does not instantly affect your system. I may add that feature later as optional, but it would mean just another daemon.

"It'd be nice if there was some noob-friendly help to the settings."
I am really surprised about that because they are not really complicated. What's the problem?
If more people don't understand them I'll add an entry to the knowledge base.

Report

C

unknownSpirit

9 years ago

Ok I'll add some tooltips.

Report

9

H00K

9 years ago

Probably simple mouse-over tool-tips would be enough.

Mainly:
* what's the "colour limit"
* what's the difference between "simple colour change" and "colour gradiant"
* what's the difference between "data transfer rates"

...as I said, I managed to guess the options successfully, but partially by trial-and-error.

Report

C

unknownSpirit

9 years ago

For the time being the plasmoid is finished.
Unfortunately I do not have any bug reports even though there are many negative votes. I've no problem with bad votes, but by JUST voting bad the program won't improve. It's simply a sign of not having understood the importance of sufficient feedback for the development of a valuable program.
It's clearly a statement, and it's not in my favour, but that way it's not in yours either.

Report

7 years ago

1.0 Initial release
2.0 Keeping original top configuration, Panel integration
2.1 Minor ajdustment: support for multiple plasmoids
3.0 Highlighting a process passing a certain limit with an individual colour.
4.0 More configuration options (e.g. colour gradient)
4.1 Click on plasmoid opens a list of tasks ordered according to CPU usage.
5.0 Optional display of IO intensive task
5.1 Bugfixes (colour change for IO intensive task, process and rate mismatch)
5.2 Configuration option for on-click-behaviour, tooltips, whatsthis-tips
6.0 Code reorganisation, further configuration options, memory intensive task, file history log..
6.1 Optional horizontal arrangement of the tasks, saving the size
6.2 Optional font background to avoid unreadable design
7.0 Code cleanup and reorganisation, disassociation with tail, destructor, bugfixes, more configuration options, NET intensive task, etc.
7.1 Direct change of network interface supported.
8.0 Integration of own iotop and nethogs versions, IPC
9.0 Added icons and a panel mode
10.0 No tail involvement any more (only IPC), bugfixes
10.1 No blocking of plasma-desktop on startup with NET intensive task any more.
10.2 Correct behaviour on systems without user configuration for top.
10.3 Less resource consumption of nethogs, small fix concerning the configuration dialog
10.4 Added a logo
10.5 German and French translations
10.6 Further fixes of bugs (concerning units and logfile) that occurred during code reorganisation.
10.7 Bugfixes: kdesu as optional superuser trigger (for nethogs), updated library link for nethogs
10.8 Implemented several nethogs daemons compiled with different libraries/libary links, debug information
10.9 Small modification for systems with python version 3.
11.0 Easy network interface switching and advanced control over nethogs.
11.1 The last observed unchanged value for a task is displayed for an additional second if the plasmoid is updated once per second.
11.2 Integration of VirtualBox virtual machine name resolution.
11.3 Optional display of the processor that the monitored process is assigned to.
11.4 Improved error handling (at runtime and for plasmoidviewer).
11.5 Extirpation of crashes, performance optimisations, more configuration options
11.6 Iotop bug fix assuring that the task with most IO is chosen.
11.7 Support for newer kernels that deny access to IO statistics for regular users.
11.8 Improved configuration interface, bug fix concerning password prompt
11.9 Small changes to handle high update rate in panels.
12.0 Highlight change in memory amount between update intervals
12.1 Improved panel layout
12.2 Fixed VirtualBox name resolution
12.3 Major update including changes in iotop, nethogs and BusyTasks to enable advanced data collection.
12.4 Extended reset interval concerning the transfer statistics, separate colouring for sum and transfer rate.
12.5 Support for gigabyte values
12.6 Fixed iotop shared memory attachment
12.7 Bugfix concerning encoding of iotop string
12.8 Several minor optimisations (iotop, daemon organisation)
14.0 New internal configuration interface (compatibility upgrade), support for multiple workspaces
14.1 | 12.9 Timeout for network notification messages.
14.2 | 13.0 Optional Irix mode, 64-bit support, many optimizations concerning the on-click-function and the panel mode
14.3 Support for procps-ng (other configuration file)

12345678910
323
product-maker wpatalas Oct 20 2013 9 excellent
product-maker deabru Aug 03 2013 9 excellent
product-maker msx Jul 06 2013 9 excellent
product-maker laloch Mar 23 2013 3 bad
product-maker freemanoid Mar 27 2012 9 excellent
product-maker gf0710020216 Feb 22 2012 9 excellent
product-maker redhatsky Feb 18 2012 9 excellent
product-maker rvs82 Dec 20 2011 9 excellent
product-maker imurzich Nov 14 2011 9 excellent
product-maker Artcor Oct 05 2011 9 excellent
product-maker dreamsoul Oct 01 2011 3 bad
product-maker akinms Sep 27 2011 9 excellent
product-maker pipapo Sep 05 2011 9 excellent
product-maker tritemius Sep 02 2011 9 excellent
product-maker Contrast Aug 17 2011 9 excellent
product-maker Pyruzan Aug 08 2011 9 excellent
product-maker seqizz Aug 04 2011 9 excellent
product-maker H00K Aug 04 2011 9 excellent
product-maker aTanCS Aug 04 2011 9 excellent
product-maker AlexeyK Aug 03 2011 9 excellent
product-maker SeaJey Aug 03 2011 9 excellent
product-maker pvt14 Jul 31 2011 9 excellent
product-maker lazx888 Jul 28 2011 9 excellent
product-maker cptG Jul 25 2011 9 excellent
product-maker vitoubien Jul 23 2011 3 bad
product-maker bosbes Jul 22 2011 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
msx
Jul 06 2013
cosmoslx
Mar 21 2013
gf0710020216
Feb 22 2012
bosbes
Jul 22 2011
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
14.3 | 13.0
updated Sep 11 2013
added Jul 21 2011
downloads 24h
0
mediaviews 24h 0
pageviews 24h 10