While I am able to use pmlogger on localhost, I am having difficulty trying to have pmlogger log metrics from a remote host. I have made sure that pmcd is running on the remote host (it is on the localhost as well, I don't know if that matters). For the host, do we enter an IP address and a port, or simply the IP address? I have tried both, and can't seem to get it to work, the connection just times out according to pmlogger.log. The port is 44323 by default, correct? Any ideas as to what might be going wrong?
Thanks, Rohan 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? 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. Would using pmcc allow me to do this much more easily/with significantly less code?
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? 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.
Thanks, Rohan Hi Rohan,
----- Original Message -----
> How is the number for the cpu metrics calculated? For example, if the
> kernel.all.cpu.idle value is 122282400, how is that number interpreted?
> Right now, to estimate it as a percentage, I add the values for idle, sys,
> and user, and add them together. I then calculate the actual percentage as
> idle / (idle + user + sys). Is there a better way to do this, like some
> function built into the API that I didn't see?
>
Its a value in milliseconds, since the machine booted (exactly as the kernel
passes to userspace)...
$ pminfo -dtT kernel.all.cpu.idle
kernel.all.cpu.idle [total idle CPU time from /proc/stat for all CPUs]
  Data Type: 64-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
  Semantics: counter Units: millisec
Help:
total idle CPU time from /proc/stat for all CPUs
It depends what you want to do with the final value, but usually interpreting
such a value (note - "Semantics: counter") requires two samples at different
times (i.e. 2 pmFetch calls, with different result->timestamps). This is
then "rate converted" - i.e. we look at the change in value divided by the
change in time. Percentage utilisation can be then calculated by multiplying
by 100.
The pcp.pmcc python module will help you with some of this (it keeps track of
multiple values when needed, across samples, for each metric).
cheers.
--
Nathan
|