2
我想从rrd数据库读取最近7天的平均读数。我正在使用rrdtool获取相同的值,然后计算平均值。我跑了以下命令:rrdtool读取输出
> 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的增加而增加。几天?或者我做错了什么?
的确,我忽略了数据库的大小。 5分钟分辨率的数据库大小为2天读数。正如你所说的,rrdtool根据所要求的覆盖范围寻找正确的解析时间。 – 2012-04-16 17:46:37