pcp
[Top] [All Lists]

Re: PCP versions of console tools - Next Steps

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: PCP versions of console tools - Next Steps
From: Sitaram Shelke <sitaramshelke@xxxxxxxxx>
Date: Wed, 11 May 2016 22:55:20 +0530
Cc: Ryan Doyle <ryan@xxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=PA2rOi3VbU29KsJ2gJboSZsGdiS7/Cf1+35EklAFOWk=; b=wrJf0c0w5c4fuGRLU1gi5pG5/Q6L22bVOagRp1zmKgOhR7Ti3//pRZE6VSXL2kGCIh 0lzKnYtUH2Z8qaI/6rMHzOJWE2qKH+w6clFz5Yd3AFyjyw3U5nLQPFeQ9iuPxPWK5zw4 RK+xyJRrL/1QjD3CMAtLkR4sQYTA26gsOJQJcxI52wYeFXuv0xNHYExjby/z71Ubz8TJ 8BZLFKitAlItbxkpOuK5DdksoX3puAY6aIy+RYNwH7rmx57gm0yoTYN5epZZwyCdmiW6 079oUK71FZQrat5J5QYc3F6li1go816uZJInFe1D37JRsYW3NXc63ChmWl4Z1e5WQ2GT gahw==
In-reply-to: <y0mshxowm4w.fsf@xxxxxxxx>
References: <CAHnM1zzTfNgt4Hsgt_Pgq7M-yz+ewd_FehB+QMxixE1MFfKOvA@xxxxxxxxxxxxxx> <572F065E.20601@xxxxxxxxxxxx> <CAHnM1zzfB6H=-oz3HnsvByGSih6Ktj9Zo3cr-kGM5DE4npa60g@xxxxxxxxxxxxxx> <573067F5.9040409@xxxxxxxxxxxx> <CAHnM1zxDgpxK2m5AQ=pL8Dwz1nydtW36ZJC8wkj9axYDdaMiMg@xxxxxxxxxxxxxx> <57307EA4.1070204@xxxxxxxxxxxx> <CAHnM1zxJj8c6A18YUmjDXDJvc_Nwb=MwzxkCAfwUE3=OGXt25w@xxxxxxxxxxxxxx> <y0mshxowm4w.fsf@xxxxxxxx>
HiÂFrank Ch. Eigler,


On Wed, May 11, 2016 at 10:46 PM, Frank Ch. Eigler <fche@xxxxxxxxxx> wrote:

May I recommend you try the python pmfg (pmFetchGroup) API instead
of the low level one? It takes care of quite a bit of the hassle.

Thank you for the input and yes using pmFetchGroup() is the next task on my board. Ryan suggested trying pmFetch() first and then going after pmFetchGroup().Â

Based on src/pmclient/pmclient_fg.py , something like:

 Âclass TotalRead():
    Â...
    Âdef connect(self):
      Â/* decode context type & parameter via pmGetOptions* */
      Âself.fg = pmapi.fetchgroup(....)
      Âself.pids = self.fg.extend_indom('proc.psinfo.pid')

    Âdef execute(self):
      Âself.fg.fetch()
      Âfor (pid, pidname, value) in self.pids():
        try:
          print "PID %d value %d" % (pid, value())
        except:
          pass

I will definitely try this one. :)Â

Regards,
Sitaram
<Prev in Thread] Current Thread [Next in Thread>