Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TSVB] Math params._interval is incorrect when using entire timerange mode #100615

Closed
wylieconlon opened this issue May 25, 2021 · 6 comments · Fixed by #100775
Closed

[TSVB] Math params._interval is incorrect when using entire timerange mode #100615

wylieconlon opened this issue May 25, 2021 · 6 comments · Fixed by #100775
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@wylieconlon
Copy link
Contributor

wylieconlon commented May 25, 2021

params._interval is used to normalize the display of values, for example to get an average rate per second. When using the entire timerange mode, it should represent the total number of milliseconds in the time range.

Steps to reproduce:

  1. Open TSVB and add a Math function. Type params._interval into the math input.
  2. Switch to the Metric visualization type.
  3. Open Panel Options, then choose "Last value" timerange mode instead. Notice that the interval is the same.

Expected behavior: The params._interval is set to the number of milliseconds in the query, the to - from time.

With entire time range:

Screen Shot 2021-05-25 at 4 23 26 PM

With last value mode:

Screen Shot 2021-05-25 at 4 23 34 PM

@wylieconlon wylieconlon added bug Fixes for quality problems that affect the customer experience Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure labels May 25, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@alexwizp
Copy link
Contributor

Thank you @wylieconlon . This is definitely wrong

@bvader
Copy link

bvader commented May 28, 2021

@alexwizp @wylieconlon

This Also Appears to Affect the Overall Metric Calculation Too.

I have validated that this DID work in 7.11.1 but does not in 7.12.x so it looks like a regression
EDIT : Now I am not sure this did work in 7.11

See Below Timeseries

Screen Shot 2021-05-27 at 5 53 02 PM

Then The Metrics with Last Bucket is correct
Screen Shot 2021-05-27 at 5 53 17 PM

But clearly the Entire Time Range is not working as the Average should be about 400

Screen Shot 2021-05-27 at 5 53 24 PM

@bvader
Copy link

bvader commented May 28, 2021

@alexwizp @wylieconlon

Perhaps @simianhacker has a perspective.

Another point of reference when the data is NOT a Series Agg, the Last Value vs Entire Time Range works for the metric
In other words for a single series it seems to works See Below

So it looks like perhaps it is related to the Series Agg

Screen Shot 2021-05-28 at 3 52 36 PM

With Last Value ... Yup About 4.8

Screen Shot 2021-05-28 at 3 52 55 PM

Now with Entire Range Yup about 1.6

Screen Shot 2021-05-28 at 3 53 08 PM

@alexwizp
Copy link
Contributor

@bvader, thanks. I created a new issue based on your comment because I'm not sure if this issue is related to the original one. But thank you very much for this case, we will see it.

@simianhacker
Copy link
Member

@wylieconlon "Entire time range" mode didn't exist when I was actively working on TSVB. Just looking at the series_agg code, nothing stands out to me as long as the aggregation response is in the right format, it should work with one bucket just as well as many.

alexwizp added a commit that referenced this issue Jun 3, 2021
… mode (#100775)

* [TSVB] Math params._interval is incorrect when using entire timerange mode

Closes: #100615

* fix jest

* rename get -> overwrite

* apply fix for "bucket script"

* Update date_histogram.js

Co-authored-by: Kibana Machine <[email protected]>
kibanamachine added a commit to kibanamachine/kibana that referenced this issue Jun 3, 2021
… mode (elastic#100775)

* [TSVB] Math params._interval is incorrect when using entire timerange mode

Closes: elastic#100615

* fix jest

* rename get -> overwrite

* apply fix for "bucket script"

* Update date_histogram.js

Co-authored-by: Kibana Machine <[email protected]>
kibanamachine added a commit that referenced this issue Jun 3, 2021
… mode (#100775) (#101252)

* [TSVB] Math params._interval is incorrect when using entire timerange mode

Closes: #100615

* fix jest

* rename get -> overwrite

* apply fix for "bucket script"

* Update date_histogram.js

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Alexey Antonov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants