pcp
[Top] [All Lists]

draft pmval event support patch

To: pcp@xxxxxxxxxxx
Subject: draft pmval event support patch
From: David Smith <dsmith@xxxxxxxxxx>
Date: Tue, 01 Mar 2011 09:13:52 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7
Since I'm working on a PMDA that supplies event records, I really needed
pmval to have event support.  So, I stole the support from pminfo and
threw it into pmval.  I've attached the patch I used.  This is a draft
patch, since I know it needs to be improved.  This is (hopefully) a
starting point.

Known things wrong with it: it ignores pmval's column width argument, it
always errors if an instance disappeared (no 'pminfo -F'), the output
formatting might need to be improved to fit into more what pmval
normally does.

So, feel free to point out places/things that need to be improved.

Here's what it currently outputs:

# pmval -x sample.event.records

metric:    sample.event.records
host:      localhost
semantics: instantaneous value
units:     none
samples:   all
[0 event records]

[1 event record timestamp 15:31:40.000]
    --- event record [0] timestamp 09:03:24.218 flags 0x1 (point) ---

[2 event records timestamps 04:15:25.4294967...04:15:26.8589934]
    --- event record [0] timestamp 09:03:25.221 flags 0x1 (point) ---
    sample.event.type (29.0.127)
        value 1
    --- event record [1] timestamp 09:03:26.221 flags 0x1 (point) ---
    sample.event.type (29.0.127)
        value 2
    sample.event.param_64 (29.0.130)
        value -3

[5 event records (7 missed) timestamps
16:46:22.12884901...16:46:26.12884901]
    --- event record [0] timestamp 09:03:26.226 flags 0x1a
(start,id,parent) ---
    sample.event.type (29.0.127)
        value 4
    sample.event.param_u64 (29.0.131)
        value 5
    sample.event.param_string (29.0.134)
        value "6"
    --- event record [1] timestamp 09:03:27.226 flags 0x1 (point) ---
    sample.event.type (29.0.127)
        value 7
    sample.event.param_double (29.0.133)
        value 8
    sample.event.param_double (29.0.133)
        value -9
    --- event record [2] timestamp 09:03:28.226 flags 0x4 (end) ---
    sample.event.type (29.0.127)
        value 10
    sample.event.param_u64 (29.0.131)
        value 11
    sample.event.param_string (29.0.134)
        value "twelve"
    sample.event.param_string (29.0.134)
        value "thirteen"
    sample.event.param_32 (29.0.128)
        value -14
    sample.event.param_u32 (29.0.129)
        value 15
    --- event record [3] timestamp 09:03:29.226 flags 0x80000000
(missed) ---
        ==> 7 missed event records
    --- event record [4] timestamp 09:03:30.226 flags 0x1 (point) ---
    sample.event.type (29.0.127)
        value 16
    sample.event.param_float (29.0.132)
        value -17
    sample.event.param_aggregate (29.0.135)
        value 18410503204342530817 -1.371380375612005e+306
[0103070f1f3f7fff]

-- 
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

Attachment: pmval.patch
Description: Text document

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