Correct. Below code limits the sampling rate for the cpu*, load*, mem*
and net* graphs. Setting them to 0 will give you 1 second "accuracy".
Or "nice furry graphs" as Richard said (actually the "furriness" is
what the original authors wanted to prevent :-). Personally I doubt
that sampling load* and mem* at that rate. cpu* and net* may make
sense.

 Richard, yes please file a report. Unfortunatelly I spoke to soon when
I mentioned that we should get rid of the intervalls at all. Reason is
that we need to compute differences for the cpu* and net* metrics (they
are rates after all). If we want to have sub-second sampling rates, we
need to use "getimeofday" instead of "time".

--- [EMAIL PROTECTED] wrote:

> If you do want to do fast polling on the Linux or cygwin gmond, I
> found
> some hardwired code in there which effectively limits the polling
> rate
> for
> some metrics no matter what you put in the config files. (Sorry
> martin,
> have not raised a bug report yet). Anyway:
> > the code below is in the cygwin and linux metric.c files.
> > 
> > --------------------------------------------------------
> > typedef struct {
> >   uint32_t last_read;
> >   uint32_t thresh;
> >   char *name;
> >   char buffer[BUFFSIZE];
> > } timely_file;
> > 
> > timely_file proc_stat    = { 0, 15, "/proc/stat" };
> > timely_file proc_loadavg = { 0, 15, "/proc/loadavg" };
> > timely_file proc_meminfo = { 0, 30, "/proc/meminfo" };
> > timely_file proc_net_dev = { 0, 30, "/proc/net/dev" };
> > 
> > char *update_file(timely_file *tf)
> > {
> >   int now,rval;
> >   now = time(0);
> >   if(now - tf->last_read > tf->thresh) {
> >     rval = slurpfile(tf->name, tf->buffer, BUFFSIZE);
> >     if(rval == SYNAPSE_FAILURE) {
> >       err_msg("update_file() got an error from slurpfile() reading 
> > %s",
> >               tf->name);
> >       return (char *)SYNAPSE_FAILURE;
> >     }
> >     else tf->last_read = now;
> >   }
> >   return tf->buffer;
> > }
> > --------------------------------------------------------
> 
> I have set those timeout values zero, which works well and gives
> me nice spiky furry graphs.
> 
> - richard


------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www:   http://www.knobisoft.de

Reply via email to