prometheus/promql
Bryan Boreham 7d105277fe
Optimise topk where k==1 (#9365)
* Add benchmark for query_range with topk

Modify sample data so values within a metric differ

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Optimise topk where k==1

In this case we don't need a heap to keep track of values; just a single
slot is fine.

Simplify the initialization of the heap: since all cases start off as a
single-item heap we can just assign the value directly.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Allow at least one slot in results for topk, quantile

k isn't set for quantile, but we need space to start collecting values

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2021-09-21 15:57:28 +05:30
..
fuzz-data
parser Add inverse hyperbolic functions 2021-09-15 22:47:10 -04:00
testdata Add inverse hyperbolic functions 2021-09-15 22:47:10 -04:00
bench_test.go Optimise topk where k==1 (#9365) 2021-09-21 15:57:28 +05:30
engine_test.go tests: Move from t.Errorf and others. (Part 2) (#9309) 2021-09-13 21:19:20 +02:00
engine.go Optimise topk where k==1 (#9365) 2021-09-21 15:57:28 +05:30
functions_test.go Combine Appender.Add and AddFast into a single Append method. (#8489) 2021-02-18 17:37:00 +05:30
functions.go Remove parenthesis 2021-09-15 22:47:10 -04:00
fuzz.go Add new Go build tags. 2021-08-27 10:24:14 +02:00
promql_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
quantile.go Fix off-by-one error in funcHistogramQuantile / ensureMonotonic (#7393) 2020-06-15 11:32:10 +01:00
query_logger_test.go tests: Move from t.Errorf and others. (Part 2) (#9309) 2021-09-13 21:19:20 +02:00
query_logger.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
test_test.go Promtool: Add feature flags to unit tests (#8958) 2021-06-30 22:43:39 +01:00
test.go tests: Move from t.Errorf and others. (Part 2) (#9309) 2021-09-13 21:19:20 +02:00
value.go Add present_over_time (#9097) 2021-07-29 12:38:11 +02:00