summaryrefslogtreecommitdiff
path: root/qa/787
blob: b892d57efbd7efdf76868e7aa4cfabced6c2e362 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh
# PCP QA Test No. 787
# Frank's "slow" archive with <mark> records
#
# Copyright (c) 2014 Ken McDonell.  All Rights Reserved.
#
# TODO - read backwards?

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=1	# failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15

# change to true to produce detailed values in $seq.full to
# validate the interpolated values reported by pmval
#
full=false
$full && rm -f $seq.full

_summary()
{
    grep '^__pmLogRead:' | wc -l | sed -e 's/ //g'
}

_filter()
{
    sed -e "s@$tmp@TMP@g"
}

pmdumplog -xz src/slow >$tmp.tmp
echo "log records: `egrep '^([A-Z][a-z][a-z] )|([0-2][0-9]:)' <$tmp.tmp | wc -l | sed -e 's/ //g'`"

# for full output, lines look like
# Fri Jan 10 17:58:09.600 2014  60.0.32 (hinv.ncpu): value 4
#
$full && grep '<mark>' <$tmp.tmp | LC_COLLATE=POSIX sort -k 3,3n -k 4,4 >$tmp.mark

# real QA test starts here
for metric in hinv.ncpu kernel.all.nprocs pmcd.numagents
do
    echo
    echo "=== $metric ==="
    $full && pmdumplog -xz src/slow $metric | egrep '^([A-Z][a-z][a-z] )|([0-2][0-9]:)' | LC_COLLATE=POSIX sort -k 3,3n -k 4,4 >$tmp.tmp
    $full && LC_COLLATE=POSIX sort -k 3,3n -k 4,4 $tmp.tmp $tmp.mark >>$seq.full

    echo
    echo "+++ forwards +++"
    pmval -z -Dlog -t 1hr -A 1hr -a src/slow $metric 2>$tmp.err
    echo "log reads: `_summary <$tmp.err`"

    echo
    echo "+++ backwards +++"
    src/interp1 -d -s 1000 -a src/slow -t 3600 $metric

    echo "`echo $metric | sed -e 's/\./_/g'` = $metric;" >>$tmp.pmie
done

echo
echo "=== pmcd.numagents converted to discrete semantics ==="
echo "metric pmcd.numagents {  sem -> discrete }" >$tmp.config
pmlogrewrite -c $tmp.config src/slow $tmp
pmval -z -Dlog -t 1hr -A 1hr -a $tmp pmcd.numagents 2>$tmp.err \
| _filter
echo "log reads: `_summary <$tmp.err`"

echo
echo "=== all metrics at once ==="
pmie -z -a src/slow -c $tmp.pmie -t 1hr -A 1hr -v -Dlog 2>$tmp.err
echo "log reads: `_summary <$tmp.err`"


# success, all done
status=0

exit