Here's version 0.1 (up from 0.01!) of my systemtap/pcp integration work
that uses systemtap (https://sourceware.org/systemtap/) to export JSON
data and a pcp (http://www.performancecopilot.org/) python pmda that
reads and processes the JSON data.
At this point things work reasonably well (at least with the test
systemtap script I've attached). There are still lots of "FIXME"
comments spread throughout the code. This time the systemtap side of
things has come along and you no longer have to hand-write JSON to
output data. The script itself is based on some work that Will
Cohen has been doing to measure network latency. Note that the script
does output live data.
The biggest addition this time is array handling, which was a bit
tricky. I'm still not sure the indom handling on the pcp side is correct
(but it seems to follow the other python pmdas).
Here's what live data looks like from pcp:
====
# pminfo -df stap_json
stap_json.json.dummy2
Data Type: string InDom: PM_INDOM_NULL 0xffffffff
Semantics: instant Units: none
value "dummy2"
stap_json.json.dummy_array.dummy2
Data Type: string InDom: 130.1 0x20800001
Semantics: instant Units: none
inst [0 or "1"] value "def"
inst [1 or "0"] value "abc"
inst [2 or "2"] value "ghi"
stap_json.json.dummy_array.dummy1
Data Type: 64-bit int InDom: 130.1 0x20800001
Semantics: counter Units: none
inst [0 or "1"] value 2
inst [1 or "0"] value 1
inst [2 or "2"] value 3
stap_json.json.net_xmit_data.xmit_latency
Data Type: 64-bit int InDom: 130.0 0x20800000
Semantics: counter Units: none
inst [0 or "fake1"] value 0
inst [1 or "fake2"] value 0
inst [2 or "eth0"] value 319
stap_json.json.net_xmit_data.xmit_count
Data Type: 64-bit int InDom: 130.0 0x20800000
Semantics: counter Units: none
inst [0 or "fake1"] value 0
inst [1 or "fake2"] value 0
inst [2 or "eth0"] value 2304551
stap_json.json.read_count
Data Type: 64-bit int InDom: PM_INDOM_NULL 0xffffffff
Semantics: counter Units: none
value 8
stap_json.json.xstring
Data Type: string InDom: PM_INDOM_NULL 0xffffffff
Semantics: instant Units: none
value "testing, 1, 2, 3"
====
The pcp pmda still only supports one systemtap script at this point. I
ran the attached systemtap script using the following command line to
produce the output above.
# stap -m json -v ./net_xmit_json5.stp eth0 fake1 fake2
Any comments/feedback would be appreciated.
--
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
net_xmit_json5.stp
Description: Text document
pmdastap_json.python
Description: Text document
data
Description: Text document
schema
Description: Text document
|