thanos-io / promql-engine

Multi-threaded PromQL engine implementation based on the Volcano paper.
Apache License 2.0
141 stars 54 forks source link

execution: add count_values aggregation #441

Closed MichaHoffmann closed 3 months ago

MichaHoffmann commented 6 months ago

Implementation feels fairly hacky but passes acceptance tests and fuzzing! I plan to clean it up later but its a good start.

MichaHoffmann commented 3 months ago

Not that it is super important but the implementation does benchmark ok:

$ go test . -run none -bench BenchmarkInstantQuery/count_values -v
goos: linux
goarch: amd64
pkg: github.com/thanos-io/promql-engine/engine
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
BenchmarkInstantQuery
BenchmarkInstantQuery/count_values
BenchmarkInstantQuery/count_values/old_engine
BenchmarkInstantQuery/count_values/old_engine-8                   86      13438595 ns/op     3144286 B/op      30155 allocs/op
BenchmarkInstantQuery/count_values/new_engine
BenchmarkInstantQuery/count_values/new_engine-8                  136       8212708 ns/op     6139048 B/op      34614 allocs/op
PASS
ok      github.com/thanos-io/promql-engine/engine   6.812s