You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Marc M. Adkins" <mm...@Doorways.org> on 2003/07/01 22:38:45 UTC

Is Proc Info API worth doing?

A few weeks ago I suggested adding to APR an API for gathering basic
information about running processes (CPU usage, memory usage, etc.).  I had
one positive response to that and I've spent some time looking at what it
would take to build such a thing.

It's non-trivial (duh).  Windows has three or four (depending on how you
count them) separate mechanisms for acquiring different collections of
information about processes.  Linux provides the /proc/stat pseudo-file
interface which apparently is revised on an irregular basis without notice
or documentation updates.  Other *NIX variants use different mechanisms (the
source code for Proc::ProcessTable on CPAN is quite instructive).

In addition, one of the data items I was considering fairly important was
CPU % per process.  This is an example of a data item that can not be
collected at an instant in time but instead requires a duration to be
meaningful (there are potentially quite a few others).  Nor is it generally
provided:  so far only the most complex Windows interface seems to provide
it, other platforms would require it to be calculated by APR code or user
code.  This makes the potential API more intricate.

Anyway, none of this particularly scares me.  In fact, it's an interesting
problem.  But the amount of work involved is considerable and I'm wondering
about ROI.  To get to the point (finally):

* How important would this API be?
* How many people would be interested in it?
* How much use would it get?
* Should it be part of APR (or APR-Util) at all,
  or is it just plain outside of the scope of the APR?

I mean, if Apache proper needed this it would already exist.  And aside from
coding a platform-independent version of ps (or mod_ps, for that matter),
would anyone use this facility?

Much as I enjoy writing code for the pure joy of it, I have any number of
pet projects already.  I would like to contribute to ongoing efforts
(raising my open source karma) but perhaps my time would be better spent
elsewise?  I don't want to go off half-cocked and build some monstrous
extension that no one really wants or needs.

On the other hand, if there's signficant interest in this API I feel like I
have a handle on it.  And like I said, it's an interesting problem.

mma