pcp
[Top] [All Lists]

Re: [pcp] python bindings

To: Stan Cox <scox@xxxxxxxxxx>
Subject: Re: [pcp] python bindings
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 25 Jun 2012 12:24:41 +1000 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <1654580007.1114306.1340583903728.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>



Hi Stan,


pcpfans(1) in src/src/python now has the beginnings of a system
statistics collector called pm-collectl.py (appended).   The python

Looked at this a little bit more on the weekend - there were a few places where
the default output didn't quite match up with collectl output for me, so pushed a
change to change that behaviour a little.  There was a few fields that looked like
they needed to be converted to KB, and inspection of the collectl source shows
they're using 1024 bytes-per-KB - so I've changed over a few places.

Oh, I meant to post the output difference for reference too, so you can see the changes ...

nathans@verge:/source/git/pcpfans/src/python$ collectl -c 2
waiting for 1 second sample...
#<--------CPU--------><----------Disks-----------><----------Network---------->
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes   KBIn  PktIn  KBOut  PktOut
   2   0   314    410      0      0     36      6      1      4      0       4
   2   0   348    451      0      0      0      0      1      4      0       4

nathans@verge:/source/git/pcpfans/src/python$ python pm-collectl.py -c 2
#<--------CPU--------> <----------Disks-----------> <----------Network--------->
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes  KBIn  PktIn  KBOut  PktOut
   2    0  329    536    0      0      0      0     3806     23   3520     22
   3    1  362    544    0      0      0      0     3736     22   3598     23

nathans@verge:/source/git/pcpfans/src/python$ python pmcollectl.py -c 2
#<--------CPU--------><----------Disks-----------><----------Network---------->
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes   KBIn  PktIn  KBOut  PktOut
   3   1   355    590      0      0      0      0      3     25      3      22
   3   0   346    457      0      0      0      0      3     25      3      22


cheers.

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