Hi Rohan,
----- Original Message -----
> I'm having difficulty finding documentation on how to use pmcc and it's
> functions. Can you point me to a man page, or any other documentation?
>
> Would the results of using pmcc be any different than using pmapi.py
> directly?
Same end result - pmcc adds 'Convenience Classes' on top of pmapi.py,
so makes for less code that you have to write.
> Right now I have it so that I am fetching metrics from an archive
> using pmFetch, and I put the values into a Python dictionary manually.
*nod*, this is the sort of thing that is done for you by pmcc.
> Would using pmcc allow me to do this much more easily/with significantly
> less code?
Yep. The documentation leaves a bit to be desired, but there are several
good examples in the PCP git tree.
src/pcp/dmcache/pcp-dmcache.py
src/pcp/iostat/pcp-iostat.py
src/pcp/verify/pcp-verify.py
qa/src/test_pmcc.py
> I tried looking through the pmcc.py file to figure it out, but I am unsure
> about how to actually use it. Do I need to use the MetricGroupManager
> class, or do I use the MetricGroup class directly if I have a set list of
> metrics that I want to be able to retrieve data from. Also, how do make it
> use the PM_CONTEXT_ARCHIVE type instead of PM_CONTEXT_HOST? It looks like
> it defaults to host, does it know to use archive if the context used for
> creating the MetricCache had type archive?
Yep. Usually this is all handled by the 'builder' interface, which takes
a pmOptions class (command line interface handling) and turns the standard
command line options - see PCPIntro(1) - into the correct context creation
parameters.
> Also, if I use the
> MetricGroupManager, how would I fetch again? MetricGroup has the mgFetch
> function, but I don't see how I could call it with a MetricGroupManager
> instance.
It handles all of the low level fetch logic, and calls a 'printer' method
once for each sample - that has access to all of the metrics (names, descs,
instances, values, etc), which can be looked up by name.
cheers.
--
Nathan
|