3 # exercise the logging state compatibility matrix for pmlc ...
4 # initial: singular metric request: same singular metric
6 # Copyright (c) 2014 Red Hat.
7 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard filters
18 trap "$sudo rm -f $tmp $tmp.*; exit" 0 1 2 3 15
24 s/connect [0-9][0-9]*/connect PID/
28 s/ on port [0-9][0-9]*//
30 s/ at .*/ at HOSTNAME/
34 -e 's/Version [0-9].*/Version VERSION/' \
36 /pmlc commands/ { skip = 1; print "[command summary deleted ...]" }
37 /metric-name/ { skip = 0; next }
44 _filter_pmlogger_log \
46 -e '/AF event queue/d'
54 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
56 s/inst \[[0-9][0-9]* or "dks..."]/inst [DISK]/
57 s;inst \[[0-9][0-9]* or "/dev/[^"]*"];inst [DISK];
58 s;inst \[[0-9][0-9]* or ".*/dbs/.*\.dbf"];inst [FILE];
61 s/value [0-9][0-9]*\.[0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
62 s/value [0-9][0-9]*\.[0-9][0-9]*/value NUMBER/
63 s/value [0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
64 s/value [0-9][0-9]*/value NUMBER/
65 s/value \[.*]/value AGGREGATE/
66 s/value ".*"/value STRING/
68 -e "/pmcd\.pmlogger\./s/$logger_pid/LOGGER_PID/g" \
69 -e '/pmcd\.pmlogger\.port/s/value .*/value PORT/' \
70 -e '/pmcd\.pmlogger\.host/s/value ".*/value "HOST"/' \
71 -e '/pmcd\.pmlogger\.archive/s/value ".*/value "PATH"/'
76 for ctl
in mandatory advisory
78 for state
in "on once" maybe off
80 [ "$ctl $state" = "advisory maybe" ] && continue
81 for req_ctl
in mandatory advisory
83 for req_state
in "on once" maybe off
85 [ "$req_ctl $req_state" = "advisory maybe" ] && continue
87 echo "log mandatory maybe sample.seconds"; \
88 echo "# $ctl $state -> $req_ctl $req_state"; \
89 echo "log $ctl $state sample.seconds"; \
92 ( echo "log $req_ctl $req_state sample.seconds"; \
93 echo "query sample.seconds"; \
96 # need sleeps to allow pmlogger to get a look in and
97 # to allow the pmlogger socket to be closed so the
98 # next pmlc invocation can get connected
107 # real QA test starts here
108 $sudo rm -f $tmp.0 $tmp.meta
$tmp.index
$seq.full
110 # start pmlogger with the expected number of samples plus a few more
111 # to detect extra log output
113 _start_up_pmlogger
-t 0.5sec
-L -s 30 -c /dev
/null
-l $tmp.log
$tmp >$tmp.err
2>&1
115 _wait_for_pmlogger
$pid $tmp.log
117 echo "logger_pid=$pid" >>$here/$seq.full
118 $PCP_PS_PROG $PCP_PS_ALL_FLAGS |
grep '[p]mlogger' >>$here/$seq.full
119 pmlc
$logger_pid </dev
/null
>>$here/$seq.full
122 _do_cmds
$logger_pid >$tmp.out
2>&1
124 # this chews up any remaining samples quickly so pmlogger terminates
126 echo "log mandatory on 25 msec sample.long.one" \
127 | pmlc
-ie $logger_pid >>$tmp.out
2>&1
129 _filter_pmlc
<$tmp.out
131 # wait for pmlogger to terminate
133 _wait_pmlogger_end
$logger_pid
134 cat $tmp.err
$tmp.log | _filter_logger
139 echo "Uniq filtered entries from pmdumplog ..."
142 |
sed -e 's/TIMESTAMP//' -e 's/^ *//' \
143 | LC_COLLATE
=POSIX
sort -u
144 pmdumplog
$tmp >>$here/$seq.full
2>&1
146 echo "Archive log is empty"