On Thu, Jul 13, 2006 at 10:44:46AM -0700, dan c wrote:
> 
>  I'm trying to use gmetric to record data from several counters that
>  do not reset after they've been read. I tried setting the slope to
>  negative, positive and both, but all three produce identical output.
>  Any ideas?

My solution was to make a directory /var/lib/ganglia/metrics/ and put
state files there.  By recording the time and the value the last time
gmetric was run, you can calculate the average change per unit time
without predefining the time period.  I usually use 2 minutes (from
cron), but of course the timeperiod you should use is determined by your
data resolution requirements, as well as how the data changes.  Also,
it's nice to be able to change it without touching either the statefile
or the script, and it deals with changes in load that might cause your
script to run something other then *exactly* every 2 minutes.  (Mine
still crash when the load gets so high that several instantiations of th
script build up without being able to run, and then run all at once;
they complain if the time diff is zero.)

Look at just about any of the scripts in
http://ben.hartshorne.net/ganglia/ for examples of how I have done this.
Some of the metrics that I measured that don't reset include the mysql
"Questions" count (to calculate queries per second) and the disk
activity straight from /proc (for which you also need to deal with your
counter looping back to zero after hitting its max bound).

-ben

-- 
Ben Hartshorne
email: [EMAIL PROTECTED]
http://ben.hartshorne.net

Attachment: signature.asc
Description: Digital signature

Reply via email to