mikejones has asked for the wisdom of the Perl Monks concerning the following question:
I only want to see this data for a selected few process names; can we say grep? Tried an HoA, but the output was all garbbled together. Any ideas? thank you__DATA__ Name => ---- SymSPort.exe WorkingSetSize => -------------- 348160 KernelModeTime => -------------- 0.0625 UserModeTime => ------------ 0.046875 Name => ---- uphclean.exe WorkingSetSize => -------------- 155648 KernelModeTime => -------------- 0.03125 UserModeTime => ------------ 0.03125 ... ... ... and another proccess name and another process name....
use strict; use warnings; use Win32::Process::Info; use Data::Dumper; my $pio_2 = Win32::Process::Info->new (); my @pids = $pio_2->ListPids (); my @proc_info; for my $pid (@pids) { @proc_info = $pio_2->GetProcInfo($pid); for my $info (@proc_info) { for my $key (keys %{$info}) { if ($key eq 'Name' or $key eq 'WorkingSetSize' or $key eq 'UserModeTime' or $key eq 'KernelModeTime') { my $value = ${$info}{$key}; print qq(\n$key => \n), q(-) x length $key, qq(\n$value \n); } ## END IF } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32... CPU/RAM usage
by BrowserUk (Patriarch) on Jul 05, 2007 at 20:51 UTC | |
by mikejones (Scribe) on Jul 06, 2007 at 19:51 UTC | |
by BrowserUk (Patriarch) on Jul 06, 2007 at 21:34 UTC | |
|
Re:Win32... CPU/RAM usage
by johngg (Canon) on Jul 05, 2007 at 19:51 UTC | |
by mikejones (Scribe) on Jul 05, 2007 at 20:09 UTC | |
by johngg (Canon) on Jul 05, 2007 at 22:31 UTC | |
|
Re: Win32... CPU/RAM usage
by NetWallah (Canon) on Jul 05, 2007 at 20:57 UTC | |
by mikejones (Scribe) on Jul 06, 2007 at 13:52 UTC |