[TSVB] Math params._interval is incorrect when using entire timerange mode#100775
[TSVB] Math params._interval is incorrect when using entire timerange mode#100775alexwizp merged 7 commits intoelastic:masterfrom
Conversation
| }, | ||
| }, | ||
| meta: { | ||
| bucketSize: 10, |
There was a problem hiding this comment.
bucketSize was removed to avoid of any calculation in future, cause in fact we need a interval
| 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.
a separate PR (#100765) was created for that change which should be backported into 7.13.2
Kuznietsov
left a comment
There was a problem hiding this comment.
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 |
| buckets_path: getBucketsPath(bucket.field, metrics), | ||
| gap_policy: 'skip', // seems sane | ||
| unit: bucketSize, | ||
| unit: intervalString, |
There was a problem hiding this comment.
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
VladLasitsa
left a comment
There was a problem hiding this comment.
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 |
stratoula
left a comment
There was a problem hiding this comment.
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 <42973632+kibanamachine@users.noreply.github.com>
💚 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 <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Closes: #100615
Closes: #101022
Summary
params._intervalis 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

TimerangecontrolOpen TSVB and add a Math function. Type

params._intervalinto 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._intervalis set to the number of milliseconds in the query, theto - fromtime.Screens
Entire time rangemodeLast valuemode