-
Notifications
You must be signed in to change notification settings - Fork 9
/
verify.sh
executable file
·66 lines (45 loc) · 1.24 KB
/
verify.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# verify some data to see if report matches what is found in the file
# as shown by asm-metrics-aggregator.pl for file logs/asm-oravm-20150511_03.csv
METRICSFILE='logs/asm-oravm-20150511_03.csv'
SNAPSHOT='2015-05-11 15:43:58'
KEY='oravm1.*,DATA'
#head -1 logs/asm-oravm-20150511_03.csv
# Col position
READS=29
WRITES=30
ELAPSEDTIME=3
READ_TIME=33
WRITE_TIME=35
read_time=0
for i in $(grep "$SNAPSHOT" $METRICSFILE | grep "$KEY" | cut -d, -f $READ_TIME)
do
read_time=$(echo "$read_time + $i" | bc)
done
echo Read Time: $read_time
total_reads=0
for i in $(grep "$SNAPSHOT" $METRICSFILE | grep "$KEY" | cut -d, -f $READS)
do
(( total_reads += i))
done
echo Total Reads: $total_reads
################
write_time=0
for i in $(grep "$SNAPSHOT" $METRICSFILE | grep "$KEY" | cut -d, -f $WRITE_TIME)
do
write_time=$(echo "$write_time + $i" | bc)
done
echo Write Time: $write_time
total_writes=0
for i in $(grep "$SNAPSHOT" $METRICSFILE | grep "$KEY" | cut -d, -f $WRITES)
do
(( total_writes += i))
done
echo Total Writes: $total_writes
#################
elapsed_time=0
for i in $(grep "$SNAPSHOT" $METRICSFILE | grep $KEY | cut -d, -f $ELAPSEDTIME)
do
elapsed_time=$(echo "$elapsed_time + $i" | bc)
done
echo Elapsed Time: $elapsed_time