influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.62k stars 3.54k forks source link

Step interpolation with boolean data steps do not allign with points. #23174

Open devjolt opened 2 years ago

devjolt commented 2 years ago

Steps to reproduce:

  1. Get boolean data in time series and go to data explorer
  2. Trend with: from(bucket: "my_bucket") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["host"] == "thing1") |> filter(fn: (r) => r["_field"] == "valve1") |> toFloat()<-- to change data into 1 or 0!
  3. View raw data as graph
  4. customise -> options -> interpolation = step

Expected behavior: See data charted with digital steps occurring where valve1 moves from true to false or vice versa (as with linear or smooth interpolation)

Actual behavior: Data charted, but steps do not align with data occurrence times (see image) NOTE: Data aligns just fine with linear or smooth interpolation.

In this image, see where data point is vs where the steps are:

image

In this image, see where more datapoints are (couldn't screen grab all at the same time, so you get red arrows!)

image

Environment info: hosted by influx

gefaila commented 2 years ago

I am also having this issue.
In industrial setting, a boolean value would indicate the status of a valve changes between 0 and 1 Therefore a new point point indicates a change in a value This is true for most IoT cases (data is only updated on significant change) Therefore, an engineer troubleshooting an issue would expect that the rising or falling edge on the chart indicates the time of the change.

It doesn't.

Influx have not implemented this interpolation = step in a way that's consistent with an engineering understanding of timeseries data.

devjolt commented 2 years ago

Is each step rendered half way between the two changing data points?

In other words, if: 12:00:00 - True 12:00:10 - False

12:00:05 - Datapoint rendered?

That seems to hold true for all datapoints on this chart...

philjb commented 2 years ago

see also https://github.com/influxdata/ui/issues/4

philjb commented 2 years ago

This is especially an issue in histogram plot type where it is more misleading.

fudini commented 1 year ago

Is this ever going to be fixed?