If it works for you, then you get to own the query and the results :-) But "garbage in, garbage out" applies here.
What you've written doesn't "count increases". It calculates average rates of increase and scales them across the whole period, whilst skipping steps where the counter appears to have reset.
Suppose you take a window of 10 time units, which contains the following 10 samples:
. 0 ... 0 ... 3 ... 3 ... 0 ... 0 ... 0 ... 2 ... 0 ... 0 .
<-----------------> <-----------------> <----->
increase of 3 (rst) increase of 2 (rst)increase of 0
|<--------------------- 10 time units ------------------->|
I think that increase() works something like this:
. an increase of 3 over 3 time units
. an increase of 2 over 3 time units
. an increase of 0 over 1 time unit
= an increase of 5 over 7 time units
= average rate of 5/7
. scaled to a total time window of 10 units
= answer of 7.14
The value you were expecting to see was probably 5 (3+2) or possibly 8 (3+3+2).