The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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 04:23 AM
Summary Explorer Output gryffindor SUN Solaris 3 05-15-2008 08:08 AM
Directory Summary Command rbarlow UNIX for Dummies Questions & Answers 2 03-01-2005 02:24 PM
System Summary Tools vader UNIX for Dummies Questions & Answers 2 07-03-2002 02:28 PM
How do you display summary of disk usage? klannon Filesystems, Disks and Memory 3 03-12-2002 04:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-20-2008
jiarong.lu jiarong.lu is offline
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
  #2 (permalink)  
Old 02-22-2008
matt.d's Avatar
matt.d matt.d is offline
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 01:18 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0