Visual Builder - Wrong Average/Count Values

I'm trying to make a visualization for my current sensors (link: Calculate kWh)

Doing some more deep analisys on the problem, I'm facing an issue that I cannot resolve.

The average values showing in the visual builder are completely different from the real ones (doing manual math calculation). This is REALLY frustrating.

I'm doing 4 hours average/count (absolute range).

The average values should be (5m interval):

  • en_sensor1: ~ 331,98
  • en_sensor2: ~ 222,60
  • en_sensor3: ~ 38,10

Manually counting the raw data shows me 49 measures.

I'm getting (5m interval) - Which aparrently are the last values from the series:

  • en_sensor1: ~ 556,63
  • en_sensor2: ~ 166,78
  • en_sensor3: ~ 37,52

Converting the metric to count shows me 42 measures.

Time Series Visual Builder:

Metric Visual Builder showing average:

Metric Visual Builder showing count:

Using the simple "Metric" visualization, I got values closer to the real manual calculated ones as shown below:

Ps.: Using 08:05:00 as last number in time range just to make kibana get the last value from 08:00:00. Changing this to 08:00 doesn't solve the problem.

Can anybody help?


Download the Raw Data

Hey @livio.zanol
you are right, actually TSVB metric will display the average of the last bucket from the series. Depending on the interval selected (auto or any manual configured one) and the time window requested, if will compute the average/counts/anything else related to the last bucket in the time window.
To fix that, you can change the interval value to cover fully the time window selected: for example if you choose last 5 minutes as the time window, you can choose 5m to have only one bucket considered and this will compute the correct average for the full interval.

We are releasing, on 7.4, a way to fix that on TSVB adding a new option to select the last value or the full time window for metrics.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.