prometheus/utility
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
..
test Weed out our homegrown test.Tester. 2014-05-21 19:27:24 +02:00
bytesize.go Simplify compaction and expose database sizes. 2013-05-14 12:29:53 +02:00
cache.go Extract LRUCache into generic cache type. 2013-08-17 13:57:49 +02:00
deadline_client.go Add variable interpolation to notification messages. 2013-08-12 12:29:08 +02:00
embed-static.sh Update embedding script to support BSD find. 2013-03-21 11:50:13 +01:00
file_ext.go Add a check for metrics directory existence. 2013-10-22 20:54:34 +02:00
freelist.go Update low-level i'faces to reflect wireformats. 2013-09-04 17:13:58 +02:00
set_test.go Address outstanding comments from PR/47 and other cleanups. 2013-02-07 11:38:01 +01:00
set.go Optimize label matcher memory and runtime behavior. 2014-05-05 11:29:17 -04:00
strconv.go Integrate cleanups for comments in PR70. 2013-02-14 19:03:17 +01:00
time.go Swap `time.Now with testable Time.Now`. 2013-01-27 19:59:20 +01:00
uncertaintygroup_test.go Add curation remark table and refactor error mgmt. 2013-04-28 17:26:34 +02:00
uncertaintygroup.go Remove race conditions from UncertaintyGroup 2013-05-07 18:15:16 +02:00