Re: How to create a new Data Type and Consolidation Function?

Dan Cech <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
On 4/12/2011 1:38 PM, Long V wrote:
> My function is keeping a SUM of the COUNTER difference. Let's illustrate with an
>
> example.
>
> time           ___1 ___2 ___3 ___4 ___5 ___6 ___7 ___8
> counter_value  _300 _450 _450 _900 1200 1800 2100 2550
> diff_sum_res_1 _300 _150 ___0 _450 _300 _600 _300 _450
> diff_sum_res_2    _450      _450      _900      _750
> diff_sum_res_4         _900                1650

Back up a second, for a regular COUNTER the rate is just the raw 
difference divided by the time delta, so you can construct your 
cumulative difference data from the AVERAGE easily with a CDEF.

Assuming a 60 second step:

time           ___0 ___1 ___2 ___3 ___4 ___5 ___6 ___7 ___8
counter_value  ___0 _300 _450 _450 _900 1200 1800 2100 2550
rate1               ___5 _2.5 ___0 _7.5 ___5 __10 ___5 _7.5
rate1 * 60          _300 _150 ___0 _450 _300 _600 _300 _450
rate2                  3.75      3.75     _7.5       6.25
rate2 * 120            _450      _450     _900       _750
rate3                       3.75                6.875
rate3 * 240                 _900                _1650

What am I missing here?

Dan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.