Changes committed to git://oss.sgi.com/nathans/pcp.git dev
qa/src/GNUlocaldefs | 1
qa/src/test_pcp_getopts.python | 110 +++++
qa/src/test_pcp_options.python | 93 ++++
src/pcp/uptime/GNUmakefile | 28 +
src/pcp/uptime/pcp-uptime.py | 121 ++++++
src/python/pcp/pmapi.py | 260 ++++++++++++-
src/python/pmapi.c | 809 ++++++++++++++++++++++++++++++++++++++++-
7 files changed, 1403 insertions(+), 19 deletions(-)
commit 1b4dedbabcc9eab396e28b34ca5dfeab8f1a4277
Author: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue Apr 1 17:47:26 2014 +1100
Initial Python script support for auto-command-line-parsing
Support for long options and automatic PCP option parsing on
the command lines of python monitor tools. A new pmOptions
class is added to the pmapi python module, and a classmethod
on the pmContext class allows it to be injected into the new
context creation process.
A sample program pcp-uptime.py is added here, which will go
on to become one of the pcp(1) sub-commands talked about so
long ago now. It's output-compatible with the Linux uptime
command, but supports historical queries like "what was the
machine uptime/loadavg/nusers at time X on day Y".
Two test scripts are also added to exercise the python APIs.
Further work remains to drive these scripts via qa/check...
will follow soon, next commit.
|