Add functions for regex replacement, sorting and humanizing.

Change-Id: I471c7a8087cd5432b51afce811b591b11583a0c3
Only log every query when debugging.

Change-Id: I4f988d81cda6f6deb0ed7f497de4aa75409b158f
Add title and match functions.

Change-Id: Ifd376c2935e22d378e7afa06122642847a237d78
Make Prometheus in header link to status page.

This is consistent with alertmanager, and more intiutive for users.

The graphs page just has graphs, so remove mention of consoles.

Change-Id: I87780a4ade33697a6095423e1a7de47d341d2838
Use html/template for console templates and add template libary support.

Add a function to bypass the new auto-escaping.
Add a function to workaround go's templates only allowing passing in one argument.

Change-Id: Id7aa3f95e7c227692dc22108388b1d9b1e2eec99
Add humanizeDuration function.

This attempts to reasonably handle things from weekly cronjobs,
to rpcs taking ns to things that are usually ms but jump to over a second.

For consistency, stop putting spaces before prefixes.

Change-Id: I6407879187b25680b323cd70254e205315b5fc3c
Remove the broken "User Dashboard" link.

Due to the lack of a </a>, this makes the entire header render badly.
Accordingly it's safe to assume noone is using it, so remove it.
With the new console template support, we'll need to something a bit
more nuanced later.

Change-Id: I3424bed6aea18cbd4c63ad48f98808098dadc3ad
Treat non-200 HTTP response as error.

Change-Id: I2a9f3b47012b3c4839be53aa44c66d16dd41a24a
Migrate to new client_golang.

This change will only be submitted when the new client_golang has been
moved to the new version.

Change-Id: Ifceb59333072a08286a8ac910709a8ba2e3a1581
Only evict memory series after they are on disk.

This fixes the problem where samples become temporarily unavailable for
queries while they are being flushed to disk. Although the entire
flushing code could use some major refactoring, I'm explicitly trying to
do the minimal change to fix the problem since there's a whole new
storage implementation in the pipeline.

Change-Id: I0f5393a30b88654c73567456aeaea62f8b3756d9
Speed up disk flushes by removing unnecessary sort.

The first sort in groupByFingerprint already ensures that all resulting sample
lists contain only one fingerprint. We also already assume that all
samples passed into AppendSamples (and thus groupByFingerprint) are
chronologically sorted within each fingerprint.

The extra chronological sort is thus superfluous. Furthermore, this
second sort didn't only sort chronologically, but also compared all
metric fingerprints again (although we already know that we're only
sorting within samples for the same fingerprint). This caused a huge
memory and runtime overhead.

In a heavily loaded real Prometheus, this brought down disk flush times
from ~9 minutes to ~1 minute.

OLD:
BenchmarkLevelDBAppendRepeatingValues   5  331391808 ns/op  44542953 B/op   597788 allocs/op
BenchmarkLevelDBAppendsRepeatingValues  5  329893512 ns/op  46968288 B/op  3104373 allocs/op

NEW:
BenchmarkLevelDBAppendRepeatingValues   5  299298635 ns/op  43329497 B/op   567616 allocs/op
BenchmarkLevelDBAppendsRepeatingValues 20   92204601 ns/op   1779454 B/op    70975 allocs/op

Change-Id: Ie2d8db3569b0102a18010f9e106e391fda7f7883
Prometheus version 0.6.0.

Change-Id: I50f6b69cca952eedf9a62b9a8f58e0fb633a83ed
Remove work-around that required copying all bytes of a scrape.

Now that the subtle bug in matttproud/golang_protobuf_extensions is
fixed, we do not need to copy the bytes of a scrape into a buffer
first before starting to parse it.

Change-Id: Ib73ecae16173ddd219cda56388a8f853332f8853
Fix console handler.

This was accidnetally broken in 2128d9d81196f92432c4016bccfeab3f7af3f06a.

Change-Id: I50ea1fdb8ae4d28ae4555410bee97e5037692aa5
Build prometheus tools as well

Change-Id: I49d5ca4d6ff715e8a6631caf052de309b91b0b1b
Expose path used to get to console to console.

Change-Id: I72386a2d4e53863da302ecc5c7e44d6c310197e0
Let consoles get graph links from experssions.

Rename ConsoleLinkFromExpression, as we now have consoles.

Change-Id: I7ed2c9c83863adb390b51121dd9736845f7bcdfc
Add 'tmpl', a 'template' for non-string literal names.

Change-Id: I6a03a5c5d20029cf414562efa7745ed6c53b2731
Fix HTTP connection leak upon non-OK status.

Change-Id: Ie7fbd7dcc089b8306b40631be3e3d736c23c1cd3
Add abs() and over-time aggregation functions.

This implements aggregation functions over time as request in
https://github.com/prometheus/prometheus/issues/383.

Change-Id: Ifd69b850de8cfdf6e7a6c0e042056fa4c672410e