pcp
[Top] [All Lists]

pmrep: new QA test

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pmrep: new QA test
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 20 Jun 2016 21:07:50 +0300
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
Hi,

Below is a QA test case utilizing the recently added rep archive which
contains more or less every type of metric seen in real-life (see
mk.rep.sh for a complete list of metrics).

The output looks expected to me so I think we can add this case and
need no pmrep fixes due to this. But it might not be such a bad idea
to run some other clients against the same metrics as well to make
sure their all provide at least mostly consistent output.

If you spot a case which might warrant further investigation, please
let me know.

---
 qa/1071     |  95 ++++++++++++++++++++++++++++++++++++++
 qa/1071.out | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qa/group    |   1 +
 3 files changed, 246 insertions(+)
 create mode 100755 qa/1071
 create mode 100644 qa/1071.out

diff --git a/qa/1071 b/qa/1071
new file mode 100755
index 0000000..400aabf
--- /dev/null
+++ b/qa/1071
@@ -0,0 +1,95 @@
+#!/bin/sh
+# PCP QA Test No. 1071
+# Exercise pmrep with a wide range of different types of metrics.
+# See archives/mk.rep.sh for the types being tested against.
+#
+# Copyright (c) 2016 Red Hat.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+. ./common.python
+
+$python -c "from pcp import pmapi" >/dev/null 2>&1
+[ $? -eq 0 ] || _notrun "python pcp pmapi module not installed"
+$python -c "from collections import OrderedDict" >/dev/null 2>&1
+[ $? -eq 0 ] || _notrun "python collections OrderedDict module not installed"
+
+which pmrep >/dev/null 2>&1 || _notrun "pmrep not installed"
+
+status=1       # failure is the default!
+$sudo rm -rf $tmp $tmp.* $seq.full
+trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+
+_path_filter()
+{
+    sed \
+       -e "s#$here#QAPATH#g" \
+    #end
+}
+
+#  timezone: :Australia/Melbourne (creation, current is AEDT-11)
+#  this is not deterministic .......................... ^^^^^^^
+#  and
+#  timezone: AEDT-11
+#            ^^^^ ... ditto
+#
+#  we also need to filter for AEST-10 during standard timezone
+#  as it appears that pmrep will report the change in -11 to -10
+_archive_filter()
+{
+    sed \
+       -e '/timezone/s/current is .*)/current is ...)/' \
+        -e '/timezone/s/ (reporting.*)//' \
+       -e '/timezone:/s/[A-Z][A-Z]*-11/...-11/' \
+       -e '/timezone:/s/[A-Z][A-Z]*-10/...-11/' \
+    #end
+}
+
+log="--archive $here/archives/rep -z"
+metrics1="
+    kernel.uname.sysname
+    hinv.machine
+    kernel.all.lastpid
+    mem.util.used
+    network.tcpconn.close
+    kernel.all.uptime
+    hinv.ncpu
+    mem.physmem
+    hinv.nfilesys
+"
+metrics2="
+    proc.psinfo.start_time
+    network.interface.baudrate
+    kernel.all.hz
+    disk.all.read_bytes
+    kernel.all.sysfork
+    kernel.percpu.cpu.user
+    kernel.all.load
+    hinv.cpu.bogomips
+    hinv.cpu.clock
+    network.interface.speed
+"
+
+# real QA test starts here
+echo "== testing default metrics reporting"
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x $log $metrics1 | _archive_filter | 
_path_filter
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x $log $metrics2 | _archive_filter | 
_path_filter
+
+echo "== testing raw metrics reporting"
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -r $log $metrics1 | _archive_filter | 
_path_filter
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -r $log $metrics2 | _archive_filter | 
_path_filter
+
+echo "== testing uninterpolated metrics reporting"
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -u $log $metrics1 | _archive_filter | 
_path_filter
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -u $log $metrics2 | _archive_filter | 
_path_filter
+
+echo "== testing uninterpolated raw metrics reporting"
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -u -r $log $metrics1 | _archive_filter | 
_path_filter
+pmrep -s 9 -t 1 -p -P 4 -w 12 -x -u -r $log $metrics2 | _archive_filter | 
_path_filter
+
+# success, all done
+echo "== done"
+status=0
+exit
diff --git a/qa/1071.out b/qa/1071.out
new file mode 100644
index 0000000..d269954
--- /dev/null
+++ b/qa/1071.out
@@ -0,0 +1,150 @@
+QA output created by 1071
+== testing default metrics reporting
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 9
+  samples: 9
+ interval: 1.0 sec
+ duration: 8 sec
+
+           k.u.sysname     h.machine   k.a.lastpid      m.u.used     n.t.close 
   k.a.uptime        h.ncpu     m.physmem    h.nfilesys
+                                                           Kbyte         count 
          sec                       Kbyte         count
+14:39:13         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:14         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:15         Linux         linux         15707      13573256             0 
       507691             8      16053852             3
+14:39:16         Linux         linux         15708      13573256             0 
       507692             8      16053852             3
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 10
+  samples: 9
+ interval: 1.0 sec
+ duration: 8 sec
+
+          p.p.start_ti  n.i.baudrate        k.a.hz  d.a.read_byt   k.a.sysfork 
   k.p.c.user      k.a.load  h.c.bogomips     h.c.clock     n.i.speed
+          000001 /usr/       enp0s25                                           
         cpu0      1 minute          cpu0          cpu0       enp0s25
+              millisec        byte/s       count/s       Kbyte/s       count/s 
         util                                     count       Mbyte/s
+14:39:13            20    3168713760           100           N/A           N/A 
          N/A        0.0900     5587.4199     3029.0310   781261.9375
+14:39:14            20    3168713760           100        0.0000        0.0000 
       0.0000        0.0900     5587.4199     3029.0310   781261.9375
+14:39:15            20    3168713760           100        0.0000        0.0000 
       0.0000        0.0800     5587.4199     2800.0000   781261.9375
+14:39:16            20    3168713760           100        0.0000        1.0000 
       0.0100        0.0800     5587.4199     2800.0000   781261.9375
+== testing raw metrics reporting
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 9
+  samples: 9
+ interval: 1.0 sec
+ duration: 8 sec
+
+           k.u.sysname     h.machine   k.a.lastpid      m.u.used     n.t.close 
   k.a.uptime        h.ncpu     m.physmem    h.nfilesys
+                                                           Kbyte         count 
          sec                       Kbyte         count
+14:39:13         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:14         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:15         Linux         linux         15707      13573256             0 
       507691             8      16053852             3
+14:39:16         Linux         linux         15708      13573256             0 
       507692             8      16053852             3
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 10
+  samples: 9
+ interval: 1.0 sec
+ duration: 8 sec
+
+          p.p.start_ti  n.i.baudrate        k.a.hz  d.a.read_byt   k.a.sysfork 
   k.p.c.user      k.a.load  h.c.bogomips     h.c.clock     n.i.speed
+          000001 /usr/       enp0s25                                           
         cpu0      1 minute          cpu0          cpu0       enp0s25
+              millisec        byte/s       count/s         Kbyte         count 
     millisec                                     count       Mbyte/s
+14:39:13            20    3168713760           100       8736634       3995200 
      4349650        0.0900     5587.4199     3029.0310   781261.9375
+14:39:14            20    3168713760           100       8736634       3995200 
      4349650        0.0900     5587.4199     3029.0310   781261.9375
+14:39:15            20    3168713760           100       8736634       3995200 
      4349650        0.0800     5587.4199     2800.0000   781261.9375
+14:39:16            20    3168713760           100       8736634       3995201 
      4349660        0.0800     5587.4199     2800.0000   781261.9375
+== testing uninterpolated metrics reporting
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 9
+  samples: 9 (requested)
+ interval: N/A
+ duration: N/A
+
+           k.u.sysname     h.machine   k.a.lastpid      m.u.used     n.t.close 
   k.a.uptime        h.ncpu     m.physmem    h.nfilesys
+                                                           Kbyte         count 
          sec                       Kbyte         count
+14:39:13         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:14         Linux         linux         15707      13573380             0 
       507690             8      16053852             3
+14:39:15         Linux         linux         15707      13573256             0 
       507691             8      16053852             3
+14:39:16         Linux         linux         15708      13573256             0 
       507692             8      16053852             3
+14:39:17         Linux         linux         15710      13573800             0 
       507693             8      16053852             3
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 10
+  samples: 9 (requested)
+ interval: N/A
+ duration: N/A
+
+          p.p.start_ti  n.i.baudrate        k.a.hz  d.a.read_byt   k.a.sysfork 
   k.p.c.user      k.a.load  h.c.bogomips     h.c.clock     n.i.speed
+          000001 /usr/       enp0s25                                           
         cpu0      1 minute          cpu0          cpu0       enp0s25
+              millisec        byte/s       count/s       Kbyte/s       count/s 
         util                                     count       Mbyte/s
+14:39:13            20    3168713760           100           N/A           N/A 
          N/A        0.0900     5587.4199     3029.0310   781261.9375
+14:39:14            20    3168713760           100        0.0000        0.0000 
       0.0000        0.0900     5587.4199     2723.4370   781261.9375
+14:39:15            20    3168713760           100        0.0000        0.0000 
       0.0000        0.0800     5587.4199     2800.0000   781261.9375
+14:39:16            20    3168713760           100        0.0000        0.9999 
       0.0100        0.0800     5587.4199     2800.0000   781261.9375
+14:39:17            20    3168713760           100        0.0000        2.0002 
       0.0000        0.0800     5587.4199     2800.1089   781261.9375
+== testing uninterpolated raw metrics reporting
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 9
+  samples: 9 (requested)
+ interval: N/A
+ duration: N/A
+
+           k.u.sysname     h.machine   k.a.lastpid      m.u.used     n.t.close 
   k.a.uptime        h.ncpu     m.physmem    h.nfilesys
+                                                           Kbyte         count 
          sec                       Kbyte         count
+14:39:13         Linux         linux         15707      13573328             0 
       507689             8      16053852             3
+14:39:14         Linux         linux         15707      13573380             0 
       507690             8      16053852             3
+14:39:15         Linux         linux         15707      13573256             0 
       507691             8      16053852             3
+14:39:16         Linux         linux         15708      13573256             0 
       507692             8      16053852             3
+14:39:17         Linux         linux         15710      13573800             0 
       507693             8      16053852             3
+
+  archive: QAPATH/archives/rep
+     host: slack
+ timezone: ...-11
+    start: Wed Feb 10 14:39:13 2016
+      end: Wed Feb 10 14:39:21 2016
+  metrics: 10
+  samples: 9 (requested)
+ interval: N/A
+ duration: N/A
+
+          p.p.start_ti  n.i.baudrate        k.a.hz  d.a.read_byt   k.a.sysfork 
   k.p.c.user      k.a.load  h.c.bogomips     h.c.clock     n.i.speed
+          000001 /usr/       enp0s25                                           
         cpu0      1 minute          cpu0          cpu0       enp0s25
+              millisec        byte/s       count/s         Kbyte         count 
     millisec                                     count       Mbyte/s
+14:39:13            20    3168713760           100       8736634       3995200 
      4349650        0.0900     5587.4199     3029.0310   781261.9375
+14:39:14            20    3168713760           100       8736634       3995200 
      4349650        0.0900     5587.4199     2723.4370   781261.9375
+14:39:15            20    3168713760           100       8736634       3995200 
      4349650        0.0800     5587.4199     2800.0000   781261.9375
+14:39:16            20    3168713760           100       8736634       3995201 
      4349660        0.0800     5587.4199     2800.0000   781261.9375
+14:39:17            20    3168713760           100       8736634       3995203 
      4349660        0.0800     5587.4199     2800.1089   781261.9375
+== done
diff --git a/qa/group b/qa/group
index a755055..b3ac049 100644
--- a/qa/group
+++ b/qa/group
@@ -1253,6 +1253,7 @@ timezone
 1068 pmrep python zabbix local
 1069 pmrep python local timezone
 1070 pmrep pmimport python perl local
+1071 pmrep python local
 1079 pcp atop local
 1080 valgrind pcp atop local
 1081 python pcp local

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>
  • pmrep: new QA test, Marko Myllynen <=