3 # pmlogrewrite man page examples
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 which pmlogrewrite
>/dev
/null
2>&1 || _notrun
"pmlogrewrite not installed"
18 status
=0 # success is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
26 -e "s/^\([+-][+-][+-] TMP\...t*\).*/\1/"
33 echo "Arrgh ... cannot find $1.0" | _filter
38 echo "Arrgh ... cannot find $2.0" | _filter
41 pmdumplog
-z -a $1 |
tee -a $seq.full
>$tmp.
in
42 pmdumplog
-z -a $2 |
tee -a $seq.full
>$tmp.out
43 echo "pmdumplog diffs ..."
44 diff -u $tmp.
in $tmp.out | _filter
51 echo "Arrgh ... cannot find $1.0" | _filter
56 echo "Arrgh ... cannot find $2.0" | _filter
59 echo "--- input metadata ---"
61 echo "--- output metadata ---"
63 pmval
-zr -f 1 -w 12 -U $1 $3 |
tee -a $seq.full
>$tmp.
in
64 pmval
-zr -f 1 -w 12 -U $2 $3 |
tee -a $seq.full
>$tmp.out
65 echo "pmval diffs ..."
66 diff -u $tmp.
in $tmp.out | _filter
69 # real QA test starts here
70 sed -e '/^#/d' <<End-of-File | while read arch_args spec
71 # archive[|arg1[|arg2[|...]]] spec
73 archives/rewrite global { time -> 30 }
74 archives/rewrite global { time -> -23:59:59.999 }
75 archives/rewrite indom 29.* { indom -> 109.* }
76 archives/rewrite metric 30.*.* { pmid -> 123.*.* }
77 archives/rewrite indom 29.* { indom -> 109.* } metric sample.bin { indom -> 109.2 }
78 archives/rewrite indom 29.* { indom -> 109.* } metric sample.bin { indom -> 123.2 }
79 archives/proc indom 60.2 { inst 1 -> 60 iname "1 minute" -> "60 second" inst 5 -> 300 iname "5 minute" -> "300 second" inst 15 -> 900 iname "15 minute" -> "900 second" }
82 echo |
tee -a $seq.full
83 echo "$spec" >$tmp.config
84 echo "=== `cat $tmp.config` ===" |
tee -a $seq.full
86 pmlogrewrite
-ws -c $tmp.config
`echo $arch_args | sed -e 's/|/ /g'` $tmp.new
2>&1 | _filter
87 _cmp
`echo $arch_args | sed -e 's/|.*//'` $tmp.new
90 sed -e '/^#/d' <<End-of-File | while read arch_args spec
91 # archive[|arg1[|arg2[|...]]] spec|metric...
93 archives/babylon.pmview_v2 metric disk.dev.read { type -> U64 } metric disk.dev.write { type -> U64 } metric disk.dev.total { type -> U64 }|disk.dev.read disk.dev.write disk.dev.total
96 echo |
tee -a $seq.full
97 metrics
=`echo "$spec" | sed -e 's/.*|//'`
98 spec
=`echo "$spec" | sed -e 's/|.*//'`
99 echo "$spec" >$tmp.config
100 echo "=== `cat $tmp.config` ===" |
tee -a $seq.full
102 pmlogrewrite
-ws -c $tmp.config
`echo $arch_args | sed -e 's/|/ /g'` $tmp.new
2>&1 | _filter
105 _cmp2
`echo $arch_args | sed -e 's/|.*//'` $tmp.new
$m
109 echo |
tee -a $seq.full
110 echo "=== proc metrics migration ===" |
tee -a $seq.full
111 cat <<End-of-File >$tmp.config
112 # proc metrics are all in 7 clusters
113 metric 60.8.* { pmid -> 123.*.* }
114 metric 60.9.* { pmid -> 123.*.* }
115 metric 60.13.* { pmid -> 123.*.* }
116 metric 60.24.* { pmid -> 123.*.* }
117 metric 60.31.* { pmid -> 123.*.* }
118 metric 60.32.* { pmid -> 123.*.* }
119 metric 60.51.* { pmid -> 123.*.* }
120 # only one instance domain for Linux proc metrics
121 indom 60.9 { indom -> 123.0 }
124 pmlogrewrite
-ws -c $tmp.config archives
/proc
$tmp.new
2>&1 | _filter
126 pminfo
-m -a archives
/proc | LC_COLLATE
=POSIX
sort >$tmp.
in
127 pminfo
-m -a $tmp.new | LC_COLLATE
=POSIX
sort >$tmp.out
129 echo "pmns diffs ..."
130 diff -u $tmp.
in $tmp.out | _filter
134 pmdumplog
-z $arg archives
/proc
>$tmp.
in 2>$tmp.err
137 echo "stderr from pmdumplog -z $arg archives/proc ..."
140 pmdumplog
-z $arg $tmp.new
>$tmp.out
2>$tmp.err
143 echo "stderr from pmdumplog -z $arg $tmp.new ..." | _filter
147 echo "pmdumplog $arg diffs ..."
148 diff -u $tmp.
in $tmp.out | _filter