[rrd-developers] [PATCH 5/5] src/rrd_graph.c: Use `rrdc_fetch' if daemon is available.

Tobias Oetiker tobi at oetiker.ch
Mon May 25 11:53:58 CEST 2009


Hi Florian,

Saturday Florian Forster wrote:

> From: Florian Forster <octo at leeloo.lan.home.verplant.org>
>
> -
> -            if ((rrd_fetch_fn(im->gdes[i].rrd,
> -                              im->gdes[i].cf,
> -                              &im->gdes[i].start,
> -                              &im->gdes[i].end,
> -                              &ft_step,
> -                              &im->gdes[i].ds_cnt,
> -                              &im->gdes[i].ds_namv,
> -                              &im->gdes[i].data)) == -1) {
> -                return -1;
> +		    int status;
> +
> +		    status = rrdc_fetch (im->gdes[i].rrd,
> +				    im->gdes[i].cf,
> +				    &im->gdes[i].start,
> +				    &im->gdes[i].end,
> +				    &ft_step,
> +				    &im->gdes[i].ds_cnt,
> +				    &im->gdes[i].ds_namv,
> +				    &im->gdes[i].data);
> +		    if (status != 0)
> +			    return (status);
>              }
> +	    else
> +	    {
> +		    int status;
> +
> +		    status = rrd_fetch_fn (im->gdes[i].rrd,
> +				    im->gdes[i].cf,
> +				    &im->gdes[i].start,
> +				    &im->gdes[i].end,
> +				    &ft_step,
> +				    &im->gdes[i].ds_cnt,
> +				    &im->gdes[i].ds_namv,
> +				    &im->gdes[i].data);
> +		    if (status != 0)
> +			    return (status);
> +	    }

what is the idea behinde implementing remote access in graph
explicity instead of just telling fetch about it and having it
handle this transparently ?

cheers
tobi


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list