pcp
[Top] [All Lists]

RE: [pcp] pmlogger -u questions

To: "'Nathan Scott'" <nathans@xxxxxxxxxx>
Subject: RE: [pcp] pmlogger -u questions
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Fri, 25 Apr 2014 17:21:14 +1000
Cc: <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <158034809.5621684.1397540389674.JavaMail.zimbra@xxxxxxxxxx>
References: <01e901cf56df$4ce97de0$e6bc79a0$@internode.on.net> <1665962954.4723287.1397437104781.JavaMail.zimbra@xxxxxxxxxx> <534B4330.1060008@xxxxxxxxxxxxxxxx> <158034809.5621684.1397540389674.JavaMail.zimbra@xxxxxxxxxx>
Thread-index: AQHyaZW6bsfhxrCcQijEIAaglOJyoQLjeeRRAm7wCyYBhaK/UpqlGL6Q
> -----Original Message-----
> From: Nathan Scott [mailto:nathans@xxxxxxxxxx]
> Sent: Tuesday, 15 April 2014 3:40 PM
> ...
> OK.  It sounds possible that "kill -9" on an active logger, followed by
> replay/logcheck may be able to induce the failures of the current code, and
> demonstrate quantifiable improvements.  Maybe not reliable failure cases,
> but with sufficient iterations/entropy/gamma-rays, we should be able to
> build confidence in any changes.

The script below produces 100% failures with the older pmlogger and libpcp, and 
100% passes (no "corrupt" archives) with the newer bits where pmlogger writes 
unbuffered and one write per pmResult.

Mark this one as "done", Ma ... 8^)>

#!/bin/sh
#

. /etc/pcp.env

#tmp=/var/tmp/$$
#trap "rm -f $tmp.*; exit 0" 0 1 2 3
tmp=tmp

rm -f $tmp.*

cat <<End-of-File >$tmp.config
log mandatory on default {
    sample.colour
}
End-of-File

nfail=0
for i in 1 2 3 4 5 6 7 8 9 10
do
    rm -f $tmp.0 $tmp.meta $tmp.index
    pmlogger -c $tmp.config -l $tmp.log -t 10msec -s 10000 -r $tmp 2>&1 &
    sleep 3
    kill -KILL $!
    wait

    if pmlogcheck $tmp
    then
        echo OK
    else
        nfail=`expr $nfail + 1`
    fi
done

echo
echo "Failed $nfail of 10 attempts."

<Prev in Thread] Current Thread [Next in Thread>