如何使用 RRD 找到长期趋势?
rrdtool 新手。我想看看在 RRD 图表上建立一条最佳拟合线所需的努力,以便我们能够检测长期趋势 - 即价值随着时间的推移而增加。我最近一直在使用 Perl 模块 Statistics::LineFit 来帮助建立回归趋势。也许 RRD 本身有一个工具可以更轻松地进行线性回归拟合?
查看了 PREDICT、PREDICTSIGMA 文档并尝试了以下设置,但这给出了我下面的错误。有什么建议请。
rrdtool graph image.png --imgformat=PNG \
--start=-7days --end=+3days --width=1000 --height=200 --alt-autoscale-max \ DEF:value=value.rrd:value:AVERAGE:start=-14days \
LINE1:value#ff0000:value \
CDEF:predict=86400,-7,1800,value,PREDICT \
CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \
CDEF:upper=predict,sigma,3,*,+ \
CDEF:lower=predict,sigma,3,*,- \
LINE1:predict#00ff00:prediction \
LINE1:upper#0000ff:upper\ certainty\ limit \
LINE1:lower#0000ff:lower\ certainty\ limit \ CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \
TICK:exceeds#aa000080:1
错误
[错误: rpn 表达式无效:86400,-7,1800,value,PREDICT]
Newbie in rrdtool. I want to look at efforts required to establish a line of best fit on RRD charts so that we can detect long term trends - i.e. value is increasing over time. I have been recently using the Perl module Statistics::LineFit to help establish regression trends. Maybe there is a tool in RRD itself which makes it easier to do a linear regression fit?
Looked at the PREDICT, PREDICTSIGMA documentations and tried below settings but this gives me below error. Any suggestions please.
rrdtool graph image.png --imgformat=PNG \
--start=-7days --end=+3days --width=1000 --height=200 --alt-autoscale-max \ DEF:value=value.rrd:value:AVERAGE:start=-14days \
LINE1:value#ff0000:value \
CDEF:predict=86400,-7,1800,value,PREDICT \
CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \
CDEF:upper=predict,sigma,3,*,+ \
CDEF:lower=predict,sigma,3,*,- \
LINE1:predict#00ff00:prediction \
LINE1:upper#0000ff:upper\ certainty\ limit \
LINE1:lower#0000ff:lower\ certainty\ limit \ CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \
TICK:exceeds#aa000080:1
ERROR
[ERROR: invalid rpn expression in: 86400,-7,1800,value,PREDICT]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能想查看 rrdtool 1.4 中的 PREDICT 和 PREDICTSIGMA 函数......也许它们有帮助。
You might want to look at the PREDICT and PREDICTSIGMA functions in rrdtool 1.4 ... maybe they help.
Google 给了我这个“使用 RRDtool 进行趋势/预测”。我可以使用此页面上给出的提示找到长期趋势。希望这对其他人也有帮助。
Google gave me this "Trend / Prediction with RRDtool". I am able to find the long term trends using the hints given on this page. Hope this is helpful for other as well.
好问题。我也是一个RRD菜鸟,希望你能得到一个好的答案。根据我的经验,我唯一的评论是:
您知道 xport 命令吗?由于必须对图形数据进行特定的自定义使用,我最终只是将数据导出到 XML,并在外部进行处理。
xport
与graph
非常相似,只不过您获取的是文本而不是图形文件。我希望它不会出现这种情况,但原则上你可以计算你的线并使用 Imagemagick 或其他东西将其叠加在 rrdtool 图上。
Good question. I'm also an RRD noob and I hope you get a good answer. My only comment from my experience is this:
Are you aware of the
xport
command? Having to make specific, custom use of my graph data, I finally just exported the data to XML, processing it externally.xport
is very similar tograph
except you get text instead of a graphic file.I would hope it doesn't come to this, but in principle you could compute your line and superimpose it on the rrdtool graph using Imagemagick or something.