The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
reading ps command's output line by line s. murat Shell Programming and Scripting 5 05-22-2008 01:23 AM
Summary Explorer Output gryffindor SUN Solaris 3 05-15-2008 05:08 AM
Directory Summary Command rbarlow UNIX for Dummies Questions & Answers 2 03-01-2005 10:24 AM
System Summary Tools vader UNIX for Dummies Questions & Answers 2 07-03-2002 11:28 AM
How do you display summary of disk usage? klannon Filesystems, Disks and Memory 3 03-12-2002 12:19 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-20-2008
Registered User
 

Join Date: Feb 2008
Posts: 1
How to sum one application's cpu usage?

I want to record one application's(like oracle etc...) CPU usage summary.
I can filter by "ps". But how to sum?

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-22-2008
matt.d's Avatar
Registered User
 

Join Date: Feb 2008
Location: /dev/null
Posts: 62
On my box,
Code:
ps -e | grep oracle
Gives me output that looks like this (column numbers entered by me)
Code:
0123456789012345678901234567890
  8827 ?         0:00 oracle
  6849 ?         0:00 oracle
 25473 ?         0:12 oracle

So I guess you could do something like...
Code:
#!/usr/bin/perl

foreach (`ps -e | grep oracle | cut -c 17-21`) {
        # strip the colon
        s/://;
        $sum = $_ + $sum;
        }

        print $sum;
But I think it would be more important to look at "top" to see what oracle process is taking the most time if you are looking to tune.

Last edited by matt.d; 02-22-2008 at 09:18 AM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0