3 # Exercise pmrep configuration and various reporting modes.
5 # Copyright (c) 2015 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 which pmrep
>/dev
/null
2>&1 || _notrun
"pmrep not installed"
18 status
=1 # failure is the default!
19 $sudo rm -rf $tmp $tmp.
* $seq.full
20 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
25 -e "s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/HH:MM:SS/g" \
29 log
="--archive $here/archives/sample-secs -z"
31 # real QA test starts here
32 echo "== basic live mode reporting"
33 pmrep
-p -s 2 -t 0.25 sample.long.one | _live_filter
35 echo "== basic archive mode reporting"
36 pmrep
-z -p -s 5 -t 2 -P 2 --archive $here/archives
/sample-secs \
37 sample.seconds sample.milliseconds
39 echo "== basic configuration file handling"
40 echo > $tmp.config
<<EOF
42 msecs = sample.milliseconds
44 pmrep
-s 5 -t 2 $log -c $tmp.config sample
46 echo "== exercise raw counter mode "
47 pmrep
-s 5 -t 2 $log -c $tmp.config
-r sample
49 echo "== exercise CSV and alternate delimiters"
50 pmrep
-s 5 -t 2 $log -c $tmp.config
-o csv
-p -P 1 sample
51 pmrep
-s 5 -t 2 $log -c $tmp.config
-o csv
--delimiter '|' sample
53 echo "== exercise repeated headers option"
54 pmrep
-s 5 -t 2 $log -E 2 sample.seconds
56 echo "== exercise units conversion options"
57 pmrep
-s 5 -t 2 $log -p -y microsec sample
59 echo "== derived metrics configuration file"
60 cat > $tmp.derived
<<EOF
61 sample.combo = sample.seconds + (sample.milliseconds / 1000)
63 pmrep
-s 5 -t 2 $log -e $tmp.derived sample.combo
65 echo "== derived metrics directly on command line"
66 combo
="sample.combo = sample.seconds + (sample.milliseconds / 1000)"
67 pmrep
-s 5 -t 2 $log -e "$combo" sample.combo
69 echo "== extended existing sample configuration"
70 cp $tmp.config
$tmp.dconfig
71 cat >> $tmp.dconfig
<<EOF
75 pmrep
-s 5 -t 2 $log -e $tmp.derived
-c $tmp.dconfig sample
77 echo "== exercise good config version"
78 echo '[options]' > $tmp.vconfig
79 echo 'version = 1' >> $tmp.vconfig
80 cat $tmp.config
>> $tmp.vconfig
81 pmrep
-s 5 -t 2 $log -c $tmp.vconfig sample
82 echo "== exercise bad config version"
83 echo '[options]' > $tmp.vconfig
84 echo 'version = 99' >> $tmp.vconfig
85 cat $tmp.config
>> $tmp.vconfig
86 pmrep
-s 5 -t 2 $log -c $tmp.vconfig sample