pmrep: update TODO, man page
[pcp.git] / qa / 777
blob7fa674c8f11f2336dff899140a39c5cc1d95fae3
1 #!/bin/sh
2 # PCP QA Test No. 777
3 # instant() for derived metrics
5 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 cat <<End-of-File >$tmp.config
21 qa.instant.milliseconds = instant(sample.milliseconds)
22 qa.instant.ulong.bin_ctr = instant(sample.ulong.bin_ctr)
23 qa.instant.lights = instant(sample.lights)
24 qa.instant.dynamic.discrete = instant(sample.dynamic.discrete)
25 qa.instant.drift = instant(sampledso.drift)
26 qa.instant.pmlogger.port = instant(pmcd.pmlogger.port)
27 End-of-File
29 # real QA test starts here
30 export PCP_DERIVED_CONFIG=$tmp.config
31 pmprobe -v qa.instant.milliseconds sample.milliseconds >$tmp.out
32 cat $tmp.out >>$here/$seq.full
33 # expect 3rd value to be the same in these two lines of output ...
34 # qa.instant.milliseconds 1 91065894.656
35 # sample.milliseconds 1 91065894.656
37 $PCP_AWK_PROG <$tmp.out '
38 NR == 1 { t = $3 }
39 NR == 2 { if (t == $3) print "OK"
40 else print "qa.instant.milliseconds",t,"!= sample.milliseconds",$3
43 echo
44 echo "=== metadata ==="
45 pminfo -d \
46 sample.milliseconds qa.instant.milliseconds \
47 sample.ulong.bin_ctr qa.instant.ulong.bin_ctr \
48 sample.lights qa.instant.lights \
49 sample.dynamic.discrete qa.instant.dynamic.discrete \
50 sampledso.drift qa.instant.drift \
51 pmcd.pmlogger.port qa.instant.pmlogger.port \
53 echo
54 echo "=== pmie tests ==="
55 cat <<End-of-File >$tmp.pmie
56 uncooked = sample.ulong.bin_ctr;
57 cooked = qa.instant.ulong.bin_ctr / 1024;
58 reverse = rate(qa.instant.milliseconds) == sample.milliseconds;
59 reverse2 = all_inst (qa.instant.dynamic.discrete == sample.dynamic.discrete);
60 reverse3 = qa.instant.drift == sampledso.drift;
61 End-of-File
63 pmie -v -c $tmp.pmie -t 1sec -T 3sec 2>&1 \
64 | sed -e '/ Info: evaluator exiting/d'
66 echo
67 echo "=== archive tests ==="
68 cat <<End-of-File >$tmp.pmie
69 raw = sample.milliseconds;
70 cooked = qa.instant.milliseconds;
71 reverse = rate(qa.instant.milliseconds) == sample.milliseconds;
72 reverse4 = qa.instant.pmlogger.port == pmcd.pmlogger.port;
73 End-of-File
74 pmie -v -z -c $tmp.pmie -t 10sec -A 10sec -a archives/sample-secs 2>&1 \
75 | sed -e '/ Info: evaluator exiting/d'
77 echo
78 pmval -z -t 15sec -A 15sec -a archives/951127.23.01_v2 sample.lights
79 pmval -z -t 15sec -A 15sec -a archives/951127.23.01_v2 qa.instant.lights
81 # success, all done
82 status=0
84 exit