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
top of the muffin to you (Score:1)
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
Re:top of the muffin to you (Score:2)
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
Re:top of the muffin to you (Score:1)
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...
Re:top of the muffin to you (Score:2)
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