[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-hardware-devel
Subject: [Kde-hardware-devel] Ksysguardd and solid
From: "John Tapsell" <johnflux () gmail ! com>
Date: 2006-06-29 18:37:35
Message-ID: 43d8ce650606291137l9b6a666k4bcdbaf1caaad93d () mail ! gmail ! com
[Download RAW message or body]
Hey all,
In ksysguard there is a daemon, ksysguardd. This is a C/C++ program
with a different source for each OS (Linux, FreeBSD etc). This is in
kdebase/workspace/ksysguard/ksysguardd/Linux/
ksysguard runs ksysguardd and talks to it via stdin and stdout. It
conversation is like:
ksysguardd> ps?
Name PID PPID UID GID Status User% System% Nice
VmSize VmRss Login Command
s d d d d S f f d
D D s s
ksysguardd>
Then to get the data for ps:
ksysguardd> ps
init 1 0 0 0 sleeping 0.00 0.00
0 2640 580 root init [2]
migration/0 2 1 0 0 sleeping 0.00
0.00 0 0 12 root
...
There is also an xres command, which looks like:
ksysguardd> xres?
XPid XIdentifier XPxmMem XNumPxm XMemOther
d s D d D
and:
4969 KDE Desktop 7919176 78 8032
5139 http://mail.google.com - Google Mail - Compose Mail - Mozilla
Firefox 23449584 1194 26056
5001 KDE Wallet Manager 20024 11 888
...
In ksysguard, I call "ps" every 2 seconds (it's very fast) and xres
every 6 seconds or so (it can take about 2 seconds to run sometimes)
What I do next is a bit complicated. I basically look at the new data
and compare it against what I already know. Thus I can deduce what
are new processes, what processes disapeared, which processes have
changed, and so on. I then emit changed information only for what has
changed.
This allows the view to update smoothly, allows selections to be kept,
and reduces the redrawing needed.
Now I mention this because I think it would be nice to keep this model
in solid, so that any app can use the model.
_______________________________________________
Kde-hardware-devel mailing list
Kde-hardware-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-hardware-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic