jepri has asked for the wisdom of the Perl Monks concerning the following question:
As you can see, there is no indication of when a sample is finished, only the header for the next sample (one second later). I don't seem to have the source for mpstat, and anyway it's not good to require people to recompile their system utilities with a version you provide.
At the current moment, I'm reading it in like this:while (1){ $_=<CPUSTAT>; last if /CPU/; push @tmp, $_; }
Could someone recommend a better way? This lacks a little style, and is also always 1 second behind. Note that I can't just count the CPUs the first time around because on a Sun, they can change while the program is running.
____________________
Jeremy
I didn't believe in evil until I dated it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nicer way of reading system monitor's output
by Cine (Friar) on Jul 31, 2002 at 08:18 UTC | |
by jepri (Parson) on Jul 31, 2002 at 23:29 UTC | |
by Cine (Friar) on Aug 01, 2002 at 18:15 UTC | |
|
Re: Nicer way of reading system monitor's output
by jepri (Parson) on Jul 31, 2002 at 07:00 UTC |