prometheus/rules/ast
Julius Volz c582ae73c2 Implement topk() and bottomk() functions.
To achieve O(log n * k) runtime, this uses a heap to track the current
bottom-k or top-k elements while iterating over the full set of
available elements.

It would be possible to reuse more code between topk and bottomk, but I
decided for some more duplication for the sake of clarity.

This fixes https://github.com/prometheus/prometheus/issues/399

Change-Id: I7487ddaadbe7acb22ca2cf2283ba6e7915f2b336
2014-11-25 17:02:00 +01:00
..
ast.go Separate storage implementation from interfaces. 2014-04-16 13:30:19 +02:00
functions.go Implement topk() and bottomk() functions. 2014-11-25 17:02:00 +01:00
functions_test.go Use custom timestamp type for sample timestamps and related code. 2013-12-03 09:11:28 +01:00
printer.go Add console and alert templates with access to all data. 2014-05-30 16:24:56 +01:00
query_analyzer.go Separate storage implementation from interfaces. 2014-04-16 13:30:19 +02:00
view_adapter.go Separate storage implementation from interfaces. 2014-04-16 13:30:19 +02:00
walk.go Make rules/ast golint clean. 2014-02-14 15:01:39 +01:00