我想从rrd数据库中获得最近7天的平均读数。我使用rrdtool fetch进行同样的操作,然后计算平均值。我运行了以下命令:
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -1days -e now | wc -l
291
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -2days -e now | wc -l
579
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -3days -e now | wc -l
126
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -4days -e now | wc -l
167
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -5days -e now | wc -l
208
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -6days -e now | wc -l
249
> rrdtool fetch /var/www/cloudrrd1/Divya.rrd AVERAGE -r 300 -s -7days -e now | wc -l
291我对读数的数量感到困惑。它不应该总是随着no的增加而增加。几天?还是我做错了什么?
发布于 2012-04-16 20:17:55
rrdtool fetch在覆盖率方面的匹配优于在分辨率上的匹配。因此,如果只有较低的分辨率rra可以覆盖请求的时间跨度,rrdtool会给出这样的结果,从而返回更少的结果……检查答案第一列中的时间戳。
https://stackoverflow.com/questions/10170438
复制相似问题