Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Monday November 04, 2002
01:08 PM

top dog

[ #8760 ]
So, I'm starting to look at writing and extension that would be much like "top", but without the "rolling display" parts. This is going to be a much bigger pain than I initially thought.

My original idea was to wrap the "top" program by William LeFebvre. Then, I thought I'd just yank out the bits I needed. The problem is I'm having a hard time deciphering some of his code - it's definitely a bit above my head. I may just start from scratch, using his code to get me started and give me ideas as I go.

One funny thing I saw was this bit of code within the boolean.h file:

#define No 0
#define Yes 1
#define Maybe 2

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • What is the purpose of the module?
    You say it won't have the rolling display... Will it have any display? I think that would be better left to client code / other modules. Rather, I think this module should simply return a current snapshot. In fact, I'm wondering why/how this module will be different from Proc::ProcessTable [uwinnipeg.ca]. The only thing a single top snapshot gives that ps doesn't is sorting.

    OTOH, if this module is really about displaying, then perhaps you should consider using Proc::ProcessTable to

    • The purpose is to monitor things like load average, process summaries, and overall memory usage - not necessarily the memory usage of individual processes. To the best of my knowledge, Proc::ProcessTable doesn't do that; at least, not without a lot of manual calculations.

      It won't have any display - it's meant for things like remote health monitoring via, say, a distributed server. I searched CPAN but didn't see anything really designed for that. If there is something (that works on Solaris), I'd love to

      • I see. You want the info that is at the top of top's display, not the itemized-by-process listing.

        What about vmstat? I'm sure you also know about uptime...

        Would it really take a lot of manual calculations to use the info coughed up by Proc::ProcessTable? I would think a series of adds would do it...

        • I see. You want the info that is at the top of top's display, not the itemized-by-process listing.

          Exactly.

          What about vmstat? I'm sure you also know about uptime.

          I've been futzing around with vmstat, trying to figure out how it works internally. I actually have an uptime interface, but I left load averages out because, well, they really don't have much to do with system uptime, per se.

          Would it really take a lot of manual calculations to use the info coughed up by Proc::ProcessTable? I would think a