I have done with particluar process memory usage adn CPU time calculation.Here is the code ..
use Win32::Process::Info; use Win32::Process::List; $proc= Win32::Process::List->new(); $pi=Win32::Process::Info->new(); %list =$proc->GetProcesses(); open FILE, '>D:\\Automation Team\\Performance\\CPUUsage\\process_detai +ls1.txt' or die $!; print FILE "Process Name\t Mem in Bytes \t CPU time \n"; while(1) { foreach $pid (keys %list) { #print "$pid : $list{$pid}\n"; $pname=$list{$pid}; #print $pname, "\n"; if (($pname eq q/jqs.exe/)) { print FILE "$list{$pid}\t"; @process_information=$pi->GetProcInfo($pid); foreach $info (@process_information) { $value_Mem = ${$info}{"WorkingSetSize" +}; print FILE "\t$value_Mem \t"; $value_Ker=${$info}{"KernelModeTime"}; #print "Kernel Time:=$value_Ker \t"; $value_User=${$info}{"UserModeTime"}; #print "UserTime:=$value_User \t"; $value_CPU=$value_Ker+$value_User; #$value_CPU=$value_CPU/10000000; print FILE "$value_CPU\t"; print FILE "\n" } } } }
I want to calculate CPU usage of this process. Thanks.
In reply to CPU Usage of particular process by mld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |