summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ac92c0)
raw | patch | inline | side by side (parent: 1ac92c0)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 25 Feb 2012 16:09:41 +0000 (16:09 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 25 Feb 2012 16:09:41 +0000 (16:09 +0000) |
program/src/rrd_fetch.c | patch | blob | history |
index bbb5314f3f87182a96b6f0c732bebff2c3211f12..47b41669fd25a390bbc2385b5e91663f6c1231de 100644 (file)
--- a/program/src/rrd_fetch.c
+++ b/program/src/rrd_fetch.c
/* find the rra which best matches the requirements */
for (i = 0; (unsigned) i < rrd.stat_head->rra_cnt; i++) {
- if (cf_conv(rrd.rra_def[i].cf_nam) == cf_idx) {
+ enum cf_en rratype=cf_conv(rrd.rra_def[i].cf_nam);
+ /* handle this RRA */
+ if (
+ /* if we found a direct match */
+ (rratype == cf_idx)
+ ||
+ /*if we found a DS with interval 1
+ and CF (requested,available) are MIN,MAX,AVERAGE,LAST
+ */
+ (
+ /* only if we are on interval 1 */
+ (rrd.rra_def[i].pdp_cnt==1)
+ && (
+ /* and requested CF is MIN,MAX,AVERAGE,LAST */
+ (cf_idx == CF_MINIMUM)
+ ||(cf_idx == CF_MAXIMUM)
+ ||(cf_idx == CF_AVERAGE)
+ ||(cf_idx == CF_LAST)
+ )
+ && (
+ /* and found CF is MIN,MAX,AVERAGE,LAST */
+ (rratype == CF_MINIMUM)
+ ||(rratype == CF_MAXIMUM)
+ ||(rratype == CF_AVERAGE)
+ ||(rratype == CF_LAST)
+ )
+ )
+ ){
cal_end = (rrd.live_head->last_up - (rrd.live_head->last_up
% (rrd.rra_def[i].pdp_cnt