-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 #100775
Conversation
@@ -86,8 +86,7 @@ describe('dateHistogram(req, panel, series)', () => { | |||
}, | |||
}, | |||
meta: { | |||
bucketSize: 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bucketSize
was removed to avoid of any calculation in future, cause in fact we need a interval
@@ -8,9 +8,9 @@ | |||
|
|||
import { mathAgg } from '../series/math'; | |||
|
|||
export function math(bucket, panel, series) { | |||
export function math(bucket, panel, series, meta, extractFields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a separate PR (#100765) was created for that change which should be backported into 7.13.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested locally, everything works as expected.
src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
Outdated
Show resolved
Hide resolved
src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-app (Team:KibanaApp) |
@alexwizp I think the same problem with |
const body = { | ||
derivative: { | ||
buckets_path: getBucketsPath(bucket.field, metrics), | ||
gap_policy: 'skip', // seems sane | ||
unit: bucketSize, | ||
unit: intervalString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the documentation there should be a string value here, not the size of the bucket
src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally in chrome
💚 Build SucceededMetrics [docs]Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @alexwizp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My dear Alexey, math and bucket script seem to work ok now. I did some tests and I think we are fine
… 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]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
… 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]>
Closes: #100615
Closes: #101022
Summary
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:
Set the following value for the
Timerange
controlOpen TSVB and add a Math function. Type
params._interval
into the math input.Switch to the Metric visualization type.
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, theto - from
time.Screens
Entire time range
modeLast value
mode