forked from davidsheffield/McMScripts
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgetTimeSize.sh
More file actions
executable file
·29 lines (24 loc) · 852 Bytes
/
getTimeSize.sh
File metadata and controls
executable file
·29 lines (24 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
################################
#
# getTimeSize.sh
#
# Script to extract the number of events, average CPU time, and file size
# from a job report and calculate the size per event in kilobytes.
#
# author: David G. Sheffield (Rutgers)
#
################################
if [ $# -ne 1 ]
then
echo "Provide job report. Usage:"
echo "sh getTimeSize.sh job_report.xml"
exit 1
fi
n=`grep "TotalEvents" $1 | awk 'BEGIN{FS=">"}{print $2}' | awk 'BEGIN{FS="<"}{print $1}'`
echo "Events: "$n
time=`grep "AvgEventCPU" $1 | awk 'BEGIN{FS="\""}{print $4}'`
echo "CPU Time [s]: "$time
total_size=`grep "Timing-tstoragefile-write-totalMegabytes" $1 | awk 'BEGIN{FS="\""}{print $4}'`
avg_size=`echo "$total_size*1024/$n" | bc -l` # Conver total size to kilobytes and calculate average per event
echo "Size [kB]: "$avg_size