Sponsored Content
Top Forums UNIX for Advanced & Expert Users Want to get average value for each hour Post 302940340 by Saravanan_0074 on Friday 3rd of April 2015 02:34:38 PM
Old 04-03-2015
Thanks for providing such a wonderful script and also help me to get the following items.

Daily Average
Hourly Average.

Output sample updated in the code.

Code:
Daily Average

03/11/15	35.52%	21.62%
03/12/15	40.20%	22.23%
03/13/15	34.92%	20.53%
03/14/15	51.13%	22.42%
03/15/15	35.94%	14.47%
03/16/15	33.22%	18.70%
03/17/15	35.30%	19.89%

Hourly Average for the month

12AM	40.53%	29.66%
1AM	36.41%	23.77%
2AM	34.87%	23.10%
3AM	40.30%	23.49%
4AM	39.05%	19.84%
5AM	41.52%	18.91%
6AM	42.05%	19.29%

Original Output File 
   Date   |  Time  |CPU % |CPU % |  %   |Mem % |
03/02/2015|00:00:00| 24.56| 20.66| 89.75| 63.48|
03/02/2015|00:05:00| 24.40| 20.72| 89.88| 63.47|
03/02/2015|00:10:00| 23.23| 19.98| 90.12| 63.48|
03/02/2015|00:15:00| 26.88| 23.25| 90.30| 63.56|
03/02/2015|00:20:00| 27.57| 23.39| 89.94| 63.49|
03/02/2015|00:25:00| 24.87| 20.46| 89.55| 63.41|
03/02/2015|00:30:00| 33.23| 29.12| 89.48| 63.35|
03/02/2015|00:35:00| 30.05| 26.04| 89.49| 63.36|
03/02/2015|00:40:00| 35.62| 31.81| 89.38| 63.25|
03/02/2015|00:45:00| 20.50| 17.03| 89.83| 63.71|
03/02/2015|00:50:00| 20.49| 17.81| 89.61| 63.50|
03/02/2015|00:55:00| 23.48| 19.37| 89.59| 63.56|
03/02/2015|01:00:00| 56.81| 49.93| 89.97| 63.88|
03/02/2015|01:05:00| 44.84| 39.46| 90.05| 63.98|
03/02/2015|01:10:00| 22.45| 19.12| 89.64| 63.57|
03/02/2015|01:15:00| 17.34| 14.53| 89.66| 63.59|
03/02/2015|01:20:00| 17.29| 14.75| 89.65| 63.58|
03/02/2015|01:25:00| 14.08| 11.54| 89.49| 63.44|
03/02/2015|01:30:00| 19.08| 16.77| 89.33| 63.28|
03/02/2015|01:35:00| 18.99| 16.80| 89.31| 63.26|
03/02/2015|01:40:00| 15.59| 13.32| 89.28| 63.23|
03/02/2015|01:45:00| 20.91| 18.27| 89.28| 63.23|
03/02/2015|01:50:00| 27.69| 24.68| 89.32| 63.27|
03/02/2015|01:55:00| 29.00| 25.71| 89.32| 63.27|
03/02/2015|02:00:00| 30.21| 25.44| 89.17| 63.21|
03/02/2015|02:05:00| 27.62| 22.90| 89.16| 63.22|
03/02/2015|02:10:00| 23.68| 19.24| 88.84| 63.19|
03/02/2015|02:15:00| 24.77| 20.00| 88.86| 63.21|
03/02/2015|02:20:00| 29.70| 25.90| 88.92| 63.27|
03/02/2015|02:25:00| 28.41| 24.24| 88.97| 63.32|
03/02/2015|02:30:00| 25.70| 22.29| 88.97| 63.29|
03/02/2015|02:35:00| 17.59| 14.77| 88.92| 63.25|
03/02/2015|02:40:00| 21.38| 18.68| 88.91| 63.23|
03/02/2015|02:45:00| 18.21| 15.20| 88.98| 63.33|
03/02/2015|02:50:00| 26.29| 23.21| 88.91| 63.26|
03/02/2015|02:55:00| 23.37| 20.37| 88.91| 63.26|
03/02/2015|03:00:00| 30.18| 25.81| 88.72| 63.05|
03/02/2015|03:05:00| 27.22| 23.42| 88.78| 63.15|
03/02/2015|03:10:00| 30.25| 26.39| 88.93| 63.30|
03/02/2015|03:15:00| 43.21| 38.60| 88.99| 63.38|
03/02/2015|03:20:00| 28.94| 25.25| 88.94| 63.33|
03/02/2015|03:25:00| 24.68| 21.22| 88.96| 63.23|
03/02/2015|03:30:00| 30.62| 25.71| 88.73| 63.13|
03/02/2015|03:35:00| 29.18| 26.12| 88.58| 62.99|
03/02/2015|03:40:00| 23.66| 21.63| 88.49| 62.90|
03/02/2015|03:45:00| 24.87| 22.66| 88.49| 62.91|
03/02/2015|03:50:00| 14.66| 12.61| 88.55| 62.97|
03/02/2015|03:55:00| 12.54| 10.53| 88.51| 62.96|
03/02/2015|04:00:00| 16.39| 13.42| 88.66| 63.09|
03/02/2015|04:05:00| 10.22|  8.06| 88.74| 63.17|


Last edited by Saravanan_0074; 04-03-2015 at 04:14 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

1 Hour less

set DAY=`date +%y%m%d` set H=`date +%H` set M=`date +%M` mailx -s "$H-Mydata" myemail@mail.com<mydata I am looking to set the current hour to have 1 hour less in the subject header: For example: let's say the system time is 8 I want to have "7-Mydata" not "8-Mydata" Can some1... (6 Replies)
Discussion started by: bobo
6 Replies

2. UNIX for Dummies Questions & Answers

an hour less in 24 hour system

My program: __________________________________ #!/bin/ksh DAY=`date +%y%m%d` H=`date +%H` M=`date +%M` day=`date +%m/%d/%y` let h=$H-1 echo DAY $DAY echo H $H echo M $M echo day $day echo h $h _____________________________________ My result: (3 Replies)
Discussion started by: bobo
3 Replies

3. Shell Programming and Scripting

help in hour grep

i have this script that checks for yesterday date and also specific hour in that ----------------------------------------------------------------- TZ=`date +%Z`+24 ;a=`date +%Y-%m-%d %k` cd logs count=0 for i in DBMaint.log do cat $i | grep $a >> file12.txt done... (0 Replies)
Discussion started by: ali560045
0 Replies

4. Shell Programming and Scripting

Counting average data per hour

Hi i have log like this : Actually i will process the data become Anybody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies

5. What is on Your Mind?

Power Hour?

I had some free time at work today so I decided to get a little practice with my shell scripts (I'm pretty new to the whole UNIX thing). I'm sure I'm not the only college student here so maybe this code will come in handy for future weekends. #!/bin/sh if then echo "No playlist... (0 Replies)
Discussion started by: thedoobieman5
0 Replies

6. Shell Programming and Scripting

Getting the last hour from a log.

I have a log like this: Jan 26 13:59:41 server2 ntpdate: step time server 91.189.94.4 offset 0.065456 sec Jan 26 13:59:41 server2 ntpd: ntpd 4.2.4p8@1.1612-o Fri Aug 6 22:49:54 UTC 2010 (1) Jan 26 13:59:41 server2 ntpd: precision = 1.000 usec Jan 26 13:59:41 server2 ntpd: ntp_io: estimated max... (2 Replies)
Discussion started by: Jotne
2 Replies

7. UNIX for Dummies Questions & Answers

Load average spikes once an hour

Hi, I am getting a high load average, around 7, once an hour. It last for about 4 minutes and makes things fairly unusable for this time. How do I find out what is using this. Looking at top the only thing running at the time is md5sum. I have looked at the crontab and there is nothing... (10 Replies)
Discussion started by: sm9ai
10 Replies

8. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

9. Shell Programming and Scripting

How to get next hour?

Hi guys I want any script to get me next hour For example Nexthour.sh 2013022823 It get me result 2013030100 Thanks a lot , I'm using Solaris 10 (5 Replies)
Discussion started by: teefa
5 Replies

10. Shell Programming and Scripting

Average of multiple time-stamped data every half hour

Hi All, Thank you for reading through my post and helping me figure out how I would be able to perform this task. For example: I have a list of continuous output collected into a file in the format as seen below: Date...........Time........C....A......... B ==========================... (5 Replies)
Discussion started by: terrychen
5 Replies
MB_CUR_MAX(3)						     Linux Programmer's Manual						     MB_CUR_MAX(3)

NAME
MB_CUR_MAX - maximum length of a multibyte character in the current locale SYNOPSIS
#include <stdlib.h> DESCRIPTION
The MB_CUR_MAX macro defines an integer expression giving the maximum number of bytes needed to represent a single wide character in the current locale. This value is locale dependent and therefore not a compile-time constant. RETURN VALUE
An integer in the range [1, MB_LEN_MAX]. The value 1 denotes traditional 8-bit encoded characters. CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. SEE ALSO
MB_LEN_MAX(3), mblen(3), mbstowcs(3), mbtowc(3), wcstombs(3), wctomb(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2015-08-08 MB_CUR_MAX(3)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy