[rrd-users] xff and dump/restore

Alexander Karptsov karp at visti.net
Sat Apr 1 12:13:58 MEST 2000


   Hi !

I don't  know any reason not to include the xfiles factor
to rrdtool dump/restore, so here the little patch:

*** src/rrd_dump.c.orig	Tue Mar 28 18:56:47 2000
--- src/rrd_dump.c	Tue Mar 28 18:57:12 2000
***************
*** 80,85 ****
--- 80,87 ----
                        * sizeof(rrd_value_t));
  	printf("\t<rra>\n");
  	printf("\t\t<cf> %s </cf>\n",rrd.rra_def[i].cf_nam);
+ 	printf("\t\t<xff> %0.10e </xff>\n",
+ 	       rrd.rra_def[i].par[RRA_cdp_xff_val].u_val);
  	printf("\t\t<pdp_per_row> %lu </pdp_per_row> <!-- %lu seconds -->\n\n",
  	       rrd.rra_def[i].pdp_cnt, rrd.rra_def[i].pdp_cnt
  	       *rrd.stat_head->pdp_step);


*** src/rrd_restore.c.orig	Tue Mar 28 18:56:57 2000
--- src/rrd_restore.c	Tue Mar 28 19:19:09 2000
***************
*** 178,183 ****
--- 178,191 ----
        /* test for valid type */
        if(cf_conv(rrd->rra_def[rrd->stat_head->rra_cnt-1].cf_nam) == -1) return -1;
  
+       read_tag(&ptr2,"xff","%lf",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val));
+       if (
+         rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val<0.0||
+         rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val>=1.0)
+       {
+ 		  rrd_set_error("the xff must always be >= 0 and < 1");
+ 		  return (-1);
+       }
        read_tag(&ptr2,"pdp_per_row","%lu",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].pdp_cnt));
        
        eat_tag(&ptr2,"cdp_prep");


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users



More information about the rrd-users mailing list