pcp
[Top] [All Lists]

Re: pcp python package/namespace experimentation

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: pcp python package/namespace experimentation
From: Stan Cox <scox@xxxxxxxxxx>
Date: Sun, 31 Mar 2013 23:21:19 -0400
Cc: Michael Werner <mtw@xxxxxxxxxxxxxx>, PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <2051621914.24702083.1364259415198.JavaMail.root@xxxxxxxxxx>
References: <2051621914.24702083.1364259415198.JavaMail.root@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 03/25/2013 08:56 PM, Nathan Scott wrote:
I also came across pcpi.py

There was an example that I still have saved away that worked with the original bindings. The current upstream bindings allow vector inputs for the primary routines, so it is a bit easier to use the raw calls now I think. Except for pmExtractValue which is still only one value fetch at a time.
 # Get ids for number cpus and load metrics
 (code, metric_ids) = pm.pmLookupName(("hinv.ncpu","kernel.all.load"))
 # Get the description of the metrics
 (code, descs) = pm.pmLookupDesc(metric_ids)
 # Fetch the current value for number cpus
 (code, results) = pm.pmFetch(metric_ids)
 # Extract the value into a scalar value
 (code, atom) = pm.pmExtractValue(results.contents.get_valfmt(0),
                                 results.contents.get_vlist(0, 0),
                                 descs[0].contents.type,
                                 pmapi.PM_TYPE_U32)

Unfortunately pcpi.py currently doesn't work due to the above changes. I am looking at getting it working again.

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