pcp
[Top] [All Lists]

Re: [pcp] programmer's guide python documentation

To: Stan Cox <scox@xxxxxxxxxx>
Subject: Re: [pcp] programmer's guide python documentation
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 3 Feb 2014 01:28:44 -0500 (EST)
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1841151293.16935708.1391165636716.JavaMail.root@xxxxxxxxxx>
References: <52E83DD8.5020403@xxxxxxxxxx> <1841151293.16935708.1391165636716.JavaMail.root@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: ZmPfsYh/qadynOmo3UOPMKVJjEsUfR4yhZL1
Thread-topic: programmer's guide python documentation
Hi Stan,

----- Original Message -----
>  [...]  - a python implementation of uptime(1).  Attached; for your
> review/perusal/amusement ... somewhere in section 3.9 - "Programming
> Issues and Examples" would suit if you like it, after the C example
> perhaps.  Sadly, it does not yet work - its exposing a bug in the py
> wrapper code for pmLocaltime(3) - also affects pmCtime(3) I think.

The current dev branch contains the fixes (turned out to be several
issues lurking here), and the attached uptime.py now works a treat.

$ ./uptime.py && /usr/bin/uptime
 17:15:29 up  1:42,  8 users,  load average: 0.06, 0.25, 0.17
 17:15:29 up  1:42,  8 users,  load average: 0.06, 0.25, 0.17

Looking at uptime.py I can't help but wish we'd got around to taking
on pmGetopt as discussed awhile back - with that, we'd have -h/-a/-S
"for free" (well, one more line of python code!).  Then, we'd get to
answer questions like "what was the system uptime at 2pm yesterday -
just prior to the outage?", etc - looking forward to that!

cheers.

--
Nathan

Attachment: uptime.py
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [pcp] programmer's guide python documentation, Nathan Scott <=