pcp
[Top] [All Lists]

[Bug 1264147] New: RFE: Python pmFetch needs to become polymorphic

To: pcp@xxxxxxxxxxx
Subject: [Bug 1264147] New: RFE: Python pmFetch needs to become polymorphic
From: bugzilla@xxxxxxxxxx
Date: Thu, 17 Sep 2015 15:38:07 +0000
Auto-submitted: auto-generated
Delivered-to: pcp@xxxxxxxxxxx
https://bugzilla.redhat.com/show_bug.cgi?id=1264147

            Bug ID: 1264147
           Summary: RFE: Python pmFetch needs to become polymorphic
           Product: Fedora
           Version: 22
         Component: pcp
          Assignee: nathans@xxxxxxxxxx
          Reporter: myllynen@xxxxxxxxxx
        QA Contact: extras-qa@xxxxxxxxxxxxxxxxx
                CC: brolley@xxxxxxxxxx, fche@xxxxxxxxxx, lberk@xxxxxxxxxx,
                    mgoodwin@xxxxxxxxxx, nathans@xxxxxxxxxx,
                    pcp@xxxxxxxxxxx, scox@xxxxxxxxxx



Description of problem:
The below is from pcp2graphite.py but would be needed in other Python
applications as well:

...
    # Convert a python list of pmids (numbers) to a ctypes LP_c_uint (a C array
of uints).
    def convert_pmids_to_ctypes(self, pmids):
        import ctypes
        from ctypes import c_uint
        pmidA = (c_uint * len(pmids))()
        for i,p in enumerate(pmids):
            pmidA[i] = c_uint(p)
        return pmidA
...

        pmid = self.context.pmLookupName(name)[0]
        self.pmids.append(pmid)

        # NB: we'd like to do: result = self.context.pmFetch(self.pmids)
        # But: pmFetch takes ctypes array-of-uint's, not a python list.  It
needs to become polymorphic.
        result = self.context.pmFetch(self.convert_pmids_to_ctypes(self.pmids))
...

Version-Release number of selected component (if applicable):
3.10.7

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug 
https://bugzilla.redhat.com/token.cgi?t=aDyVhvVR0m&a=cc_unsubscribe

<Prev in Thread] Current Thread [Next in Thread>
  • [Bug 1264147] New: RFE: Python pmFetch needs to become polymorphic, bugzilla <=