[HPADM] scripting help

From: Copeland, Daniel (Daniel.Copeland@alcoa.com)
Date: Thu May 13 2004 - 15:15:05 EDT


Admins,

I have a data file (extract process detail output) that has a data point for every interesting process for each minute of the extract. Is there an easy way to calculate the average of a particular metric for each 15 minute chunk of the overall extract (4 hrs)? Here is a piece of the file:

MWA Export 05/11/04 10:16 AM Logfile: /var/opt/perf/datafiles/ SCOPE/UX C.03.50.00 adedd75n:9000/800
        | | | Process | | Phys | Logl | Logl | IO Byte | Pri |DskSubsys| IO |Memory |System|
  Date |Time | PID | Name | CPU % |IO Rt |Rd Rt |Wr Rt | Rate |Wait %| Wait % |Wait % |Wait % |Wait %|
05/10/04|13:00| 17910|oraclet675 | 2.13| 126.3| 108| 0| 2060.9| 0.03| 96.59| 0.08| 0.00| 0.00|
05/10/04|13:00| 17940|oraclet675 | 12.61| 272.6| 171| 0| 7475.2| 0.11| 74.34| 12.08| 0.00| 0.03|
05/10/04|13:00| 2974|oraclet675 | 42.88| 428.8| 206| 0| 11468.8| 0.35| 31.20| 24.19| 0.00| 0.03|
05/10/04|13:00| 17781|oraclet675 | 0.03| 41.9| 55| 0| 457.1| 0.01| 98.48| 0.55| 0.00| 0.01|
05/10/04|13:00| 2835|oraclet675 | 1.00| 1.9| 0| 0| 43.9| 0.00| 1.21| 0.15| 0.00| 0.00|
05/10/04|13:00| 19111|oraclet675 | 16.51| 53.0| 47| 0| 690.0| 0.13| 82.07| 0.03| 0.00| 0.00|
05/10/04|13:00| 17874|oraclet675 | 6.17| 138.4| 121| 0| 2720.9| 0.13| 91.46| 1.36| 0.00| 0.01|
05/10/04|13:00| 18604|oraclet675 | 98.43| 0.1| 0| 0| 1.2| 0.20| 0.35| 0.00| 0.00| 0.00|
05/10/04|13:00| 25646|oraclet675 | 37.23| 0.0| 0| 0| 0.0| 0.08| 63.18| 0.32| 0.00| 0.00|
05/10/04|13:00| 17742|oraclet675 | 1.05| 72.1| 68| 0| 724.0| 0.01| 97.47| 0.20| 0.00| 0.03|

I want to have an output of, say the average IO Byte Rate for each 15 min interval of each process in the extract -- 4hrs / 15min = 16 data points.

I can use awk to get the average for the whole file (awk '{c=c+$9} END {printf(%d,c/NR)}') but how can I break the file down into 15min intervals. Note -- each interval will not have the same number of entries.

Thanks in advance,
Dan

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:41 EDT