pcp
[Top] [All Lists]

pcp update: fetchgroups v4: with event-field support

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pcp update: fetchgroups v4: with event-field support
From: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Date: Sat, 2 Jan 2016 00:25:22 -0500
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
Hi -

As requested, I added a fetchgroup-flavoured PM_TYPE_EVENT processor
to the work.  pcpfans.git fche/fetchgroup.  The new commit is:


commit e3e0b564111b6636ce1d81e91820bacee1c3645e
Author: Frank Ch. Eigler <fche@xxxxxxxxxx>
Date:   Sat Jan 2 00:19:10 2016 -0500

    fetchgroups: event-field support
    
    Extend the fetchgroup api with an _event variant, which processes
    named fields from named event metrics through the extract/convert/cast
    pipeline.  This lets the following toy program trace systemd/journal
    events:
    
    from pcp import pmapi
    import cpmapi as c_api
    import time
    pmfg = pmapi.fetchgroup(c_api.PM_CONTEXT_HOST, "local:")
    vvv = pmfg.extend_event("systemd.journal.records", 
field="systemd.journal.field.string")
    while True:
         pmfg.fetch()
         for ts, line in vvv():
              print ("%s : %s" % (ts, line()))
         time.sleep(1.0)
    
    Python & docs & QA included.

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