How do I get consistent values with influxdb non_negative_derivative?

前端 未结 3 634
难免孤独
难免孤独 2021-02-01 07:23

Using grafana with influxdb, I am trying to show the per-second rate of some value that is a counter. If I use the non_negative_derivative(1s) function, the value

3条回答
  •  無奈伤痛
    2021-02-01 08:04

    The problem here is that the $__interval width changes depending on the time frame you are viewing in Grafana.

    The way then to get consistent results is to take a sample from each interval (mean(), median(), or max() all work equally well) and then transform by derivative($__interval). That way your derivative changes to match your interval length as you zoom in/out.

    So, your query might look like:

    SELECT derivative(mean("mem.gc.count"), $__interval) FROM "influxdb"
    WHERE $timeFilter GROUP BY time($__interval) fill(null)
    

提交回复
热议问题