mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 19:13:23 +00:00
Merge pull request #16733 from MichaHoffmann/mhoffmann/fix-ts-of-last-over-time-histograms
promql: fix ts_of_last_over_time for histogram vectors
This commit is contained in:
commit
e81132f162
2 changed files with 9 additions and 1 deletions
|
@ -795,7 +795,7 @@ func funcTsOfLastOverTime(vals []parser.Value, _ parser.Expressions, enh *EvalNo
|
|||
|
||||
var th int64
|
||||
if len(el.Histograms) > 0 {
|
||||
th = el.Floats[len(el.Floats)-1].T
|
||||
th = el.Histograms[len(el.Histograms)-1].T
|
||||
}
|
||||
|
||||
return append(enh.Out, Sample{
|
||||
|
|
8
promql/promqltest/testdata/functions.test
vendored
8
promql/promqltest/testdata/functions.test
vendored
|
@ -1201,6 +1201,8 @@ eval instant at 90s ts_of_max_over_time(metric[90s])
|
|||
clear
|
||||
load 10s53ms
|
||||
metric 1 2 3 _ _
|
||||
metric_histogram{type="only_histogram"} {{schema:1 sum:2 count:3}}x4
|
||||
metric_histogram{type="mix"} 1 1 1 {{schema:1 sum:2 count:3}} {{schema:1 sum:2 count:3}} 1
|
||||
|
||||
eval instant at 90s ts_of_last_over_time(metric[90s])
|
||||
{} 20.106
|
||||
|
@ -1208,6 +1210,12 @@ eval instant at 90s ts_of_last_over_time(metric[90s])
|
|||
eval instant at 95s ts_of_last_over_time(metric[90s])
|
||||
{} 20.106
|
||||
|
||||
eval instant at 95s ts_of_last_over_time(metric_histogram{type="only_histogram"}[90s])
|
||||
{type="only_histogram"} 40.212
|
||||
|
||||
eval instant at 95s ts_of_last_over_time(metric_histogram{type="mix"}[90s])
|
||||
{type="mix"} 50.265
|
||||
|
||||
# Tests for quantile_over_time
|
||||
clear
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue