如何在RRDtool中创建累积的带宽使用情况(即每月减少GB)? [英] How do I create accumulated bandwidth usages in RRDtool (ie. GB's per month down)?

查看:112
本文介绍了如何在RRDtool中创建累积的带宽使用情况(即每月减少GB)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下数据来自移动电话提供商,它是在特定时间(通常每分钟)下载的kb的列表.

The following data comes from a mobile phone provider, it's a list of kb's downloaded at a certain time, usually on a per minute basis.

这不是平均值,不是最大值,而是该时间间隔的总和,可以精确跟踪数据消耗.这些图是使用PIL制作的,可以看到较大的步幅,而不是显示尖峰表示大量的数据消耗,因为它不仅表明这里发生了很多事情",而且还准确地说明了很多事情发生了"这里".例如第二张图,星期六晚上10mb 100mb.比率变化图不会提供足够的信息.

It's not the average, not the max, but the total of that time interval, which allows to track the data consumption precisely. These graphs were made with PIL, and instead of showing spikes to indicate a large data consumption, large steps can be seen, which is much more revealing, because it doesn't just tell "much happened here", but "exactly this much happened here". For example second graph Sat 10 at night 100mb. A rate-change graph wouldn't be as informative.

我也在尝试用rrd做到这一点.

I'm also trying to find a way to do this with rrd.

在使用COUNTER跟踪我的网络数据使用量时,我误导了我以为我可以精确计算每月/每周的累积数据使用量,但是现在事实证明这是一个错误的假设.

I was mislead when using the COUNTER to track my networks data usage into thinking that I would be able to precisely compute the monthly/weekly accumulated data usage, but now it turned out to be a wrong assumption.

我如何将数据存储在rrd中,以便能够轻松生成如下图所示的图形?那是通过使用ABSOLUTE并在更新它之前我减去先前的插入值吗?检查每月使用量时,精确到字节吗?

How I store my data in rrd in order to be able to easily generate graphs like below? Would that be by using ABSOLUTE and before updating it I would subtract the previous insertion value? Would that be precise down to the byte when checking the monthly usage?

推荐答案

您可以轻松地将图表中的所有值相加:

You can add up all the value in your chart quite easily:

CDEF:sum=data,$step_width,*,PREV,ADDNAN

如果您的图表仅覆盖一个月,那应该就是您要做的.如果要覆盖多个月,则必须使用IFTIME运算符的组合,以在月初将行重置为0.

if your chart covers just one month, that should be all you have todo. If you want to have it cover multiple months, you will have to use a combination of IF and TIME operators to reset the line to 0 at the start of the month.

版本1.5.4将包含一个名为STEPWIDTH的附加运算符,该运算符将步长推入堆栈,从而使其更加简单.

Version 1.5.4 will contain an additional operator called STEPWIDTH, which pushes the step width onto the stack, making this even simpler.

这篇关于如何在RRDtool中创建累积的带宽使用情况(即每月减少GB)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆