[rrd-developers] Re: LINE2 precision in rrdtool 1.1.x

Rutger Sassen rrdtool-developer at rutger.nl
Tue Jan 14 14:43:31 MET 2003


> 
> This means that in the loop at line 208 of src/rrd_fetch.c, 
> the condition "if (first_part || best_match < tmp_match)" at line 250 
> was false for the row with step 300. 
> 
> I think that changing the condition to 
>   "if (first_part || best_match <= tmp_match)"
> would help in my case. But that works only if the RRAs are sorted by 
> the step size. This is where I stuck: are the entries in this loop 
> sorted or not?

Maybe something like this would work (untested, patched from 1.0.40
so 1.1.x could be different):

    long  best_part_step_diff=0, tmp_part_step_diff=0;
    ...
    } else {
                /* best partial match */
                tmp_match = full_match;
                if (cal_start>*start)
                    tmp_match -= (cal_start-*start);
                if (cal_end<*end)
                    tmp_match -= (*end-cal_end);
                tmp_part_step_diff = labs(*step - (rrd.stat_head->pdp_step
                                              * rrd.rra_def[i].pdp_cnt));
                if (first_part || best_match < tmp_match ||
                        ((best_match == tmp_match) &&
                        (tmp_part_step_diff < best_part_step_diff) )){
                    first_part=0;
                    best_match = tmp_match;
                    best_part_rra =i;
                    best_part_step_diff = tmp_part_step_diff;
                }

Cheers,

Rutger

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



More information about the rrd-developers mailing list