I looked through rrd_create.c, and couldn't find any code that 
sorts the RRAs by step size. Thus, something like the code of 
Rutger should work. I'll do some tests soon.

Thanks, 
Stan


--- Rutger Sassen <[EMAIL PROTECTED]> wrote:
>     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;
>                 }

--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

Reply via email to