Factoring out standard system information
Scott Wheeler
wheeler at kde.org
Fri Dec 30 16:08:28 GMT 2005
On Dec 29, 2005, at 8:00 PM, Adriaan de Groot wrote:
> There's a couple of non-portable system things that are really
> popular to know
> for KDE applications. These are CPU information (load; percentage
> time idle,
> interrupt, user, etc.), swap and RAM information (free and used).
> Reading
> these data is a pain in the ass, and it's implemented who knows how
> many
> times across the KDE codebase -- superkaramba, ksysguard and the just
> discovered (and hopelessly buggy) ktimemon come to mind. I think SK
> has the
> most accurate code - at least it gives me numbers that match what
> top(1) and
> swapinfo(8) tell me. KTimeMon has support for OSF but not for
> FreeBSD, which
> is .. uncomfortable and/or weird.
>
> So would it make sense to factor this stuff out and stick it in
> kdelibs
> somewhere? ksysinfo or some such -- one central place to query system
> resource usage, so there's only one place reading /proc/icky/
> memusage or
> calling sysctlbyname("hw.memusage") or calling table() or using kvm
> (4).
I'd say that this is one of those things that could probably fairly
easily go the FD.o route. This is a problem that a lot of software
has to deal with (I maintain something similar at the office) and is
generally a pain to keep up to date, so the less versions of such
that we have in the OSS world, the better.
One thing to keep in mind for such a piece of software is how you'll
go about shipping updates -- at least on Linux it's unfortunately not
uncommon for minor changes in the proc file system (which often
happens in a kernel upgrade) to break things that parse them.
-Scott
More information about the kde-core-devel
mailing list