prometheus/promql
beorn7 836f1db04c Improve MetricsForLabelMatchers
WIP: This needs more tests.

It now gets a from and through value, which it may opportunistically
use to optimize the retrieval. With possible future range indices,
this could be used in a very efficient way. This change merely applies
some easy checks, which should nevertheless solve the use case of
heavy rule evaluations on servers with a lot of series churn.

Idea is the following:

- Only archive series that are at least as old as the headChunkTimeout
  (which was already extremely unlikely to happen).

- Then maintain a high watermark for the last archival, i.e. no
  archived series has a sample more recent than that watermark.

- Any query that doesn't reach to a time before that watermark doesn't
  have to touch the archive index at all. (A production server at
  Soundcloud with the aforementioned series churn and heavy rule
  evaluations spends 50% of its CPU time in archive index
  lookups. Since rule evaluations usually only touch very recent
  values, most of those lookup should disappear with this change.)

- Federation with a very broad label matcher will profit from this,
  too.

As a byproduct, the un-needed MetricForFingerprint method was removed
from the Storage interface.
2016-03-09 00:25:59 +01:00
..
testdata Merge branch 'beorn7/storage2' into beorn7/storage3 2016-03-02 23:02:06 +01:00
analyzer.go Improve MetricsForLabelMatchers 2016-03-09 00:25:59 +01:00
ast.go Fix various typos in comments. 2016-02-10 03:47:00 +01:00
engine.go Improve predict_linear 2016-02-25 12:10:55 +01:00
engine_test.go promql: Reduce flakiness of concurrency test 2015-09-23 10:07:30 +01:00
functions.go Improve predict_linear 2016-02-25 12:10:55 +01:00
lex.go Add without aggregator modifier. 2016-02-08 14:05:33 +00:00
lex_test.go Fix typo in lexer test. 2016-03-02 01:13:27 +01:00
parse.go use short variable assignment 2016-03-03 09:46:50 -08:00
parse_test.go rewrite operator balancing to be recursive 2016-03-02 15:56:40 -08:00
printer.go Add without aggregator modifier. 2016-02-08 14:05:33 +00:00
printer_test.go Add without aggregator modifier. 2016-02-08 14:05:33 +00:00
promql_test.go Fix most golint warnings. 2015-08-26 12:44:46 +02:00
quantile.go Switch promql types to common/model 2015-08-25 13:49:14 +02:00
test.go Fix missing comment period. 2016-03-02 09:16:56 +01:00