influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.

Home Page:https://influxdata.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Increase function should have an optional parameter stating max value of the counter

christofe-lintermans-actemium opened this issue · comments

Hi,

Imagine you are polling each second a counter:

95 ... 97 ... 99 ...
1 ... 3 ... 5

increase would give you 99, 100, 102, 104

but you know in advance the counter actually reached 100 before resetting.

so increase should actually give 101, 103, 105

Could it be possible to pass this known limit to the increase function? so the calculation would be more accurate?

Kind regards,

Christofe

Hi,
I came here to submit the same issue, glad to see you had the same idea!
I add a couple of tips:

  • this optional parameter should be named threshold (as the doc page uses this word)
  • doc should recommend to use this optional parameter only in scenarios where the counter is not manually reset

This issue has had no recent activity and will be closed soon.