Interim commit of metric model.

Change-Id: I54c74d796bd175fe056353983043a10c03974185
Fix OperatorError.

This used to work with Go 1.1, but only because of a compiler bug.
The bug is fixed in Go 1.2, so we have to fix our code now.

Change-Id: I5a9f3a15878afd750e848be33e90b05f3aa055e1
Nonexistent labels in BY-clauses shouldn't propagate to result.

This fixes bug 2. of https://github.com/prometheus/prometheus/issues/374

Change-Id: Ia4a13153616bafce5bf10597966b071434422d09
Remove overly verbose DNS-SD logging line.

Change-Id: Ie4534437ab88b9a6b99f5cb6c2f32c9588c1fff6
Upgrade to Go 1.2.

Change-Id: If8451257487edc4b76f4248f6e6b47c073dea183
Fix LevelDB closing order.

The storage itself should be closed before any of the objects passed into it
are closed (otherwise closing the storage can randomly freeze). Defers are
executed in reverse order, so closing the storage should be the last of the
defer statements.

Change-Id: Id920318b876f5b94767ed48c81221b3456770620
Add count_scalar() function.

Change-Id: I63f09dd0479d0a6b016f5f857dd39dcbda56c7f9
Store copy of metric during fingerprint caching

Problem description:
====================
If a rule evaluation referencing a metric/timeseries M happens at a time
when M doesn't have a memory timeseries yet, looking up the fingerprint
for M (via TieredStorage.GetMetricForFingerprint()) will create a new
Metric object for M which gets both: a) attached to a new empty memory
timeseries (so we don't have to ask disk for the Metric's fingerprint
next time), and b) returned to the rule evaluation layer. However, the
rule evaluation layer replaces the name label (and possibly other
labels) of the metric with the name of the recorded rule.  Since both
the rule evaluator and the memory storage share a reference to the same
Metric object, the original memory timeseries will now also be
incorrectly renamed.

Fix:
====
Instead of storing a reference to a shared metric object, take a copy of
the object when creating an empty memory timeseries for caching
purposes.

Change-Id: I9f2172696c16c10b377e6708553a46ef29390f1e
Minor test error reporting cleanup.

Change-Id: Ie11c16b4e60de7c179c6d2a86e063f4432e2000f
Merge "Fix LevelDB closing order."
Add -O3 to all C/C++ compiles.

So far, we are compiling C/C++ code without any optimization.

In non-representative, but practically relevant tests, the -O3
improved the total query time for a demanding graph by ~20%.

Change-Id: I5e8123650e53a4933ed4fbe63d0b1ca67217b865
Merge "Add -O3 to all C/C++ compiles."
Minor code cleanups.

Change-Id: Ib3729cf38b107b7f2186ccf410a745e0472e3630
Merge "Minor code cleanups."
Make Dockerfile build prometheus in container

This way the binary will be built in a clear environment and prometheus
can be added to the docker index.

Change-Id: I417fb90adf2503c990a96f4bad370b09b102e0b9
Make rules/ast golint clean.

Mostly, that means adding compliant doc strings to exported items.

Also, remove 'go vet' warnings where possible. (Some are unfortunately
not to avoid, arguably bugs in 'go vet'.)

Change-Id: I2827b6dd317492864c1383c3de1ea9eac5a219bb
Simplify QueryAnalizer.Visit().

Change-Id: I628582a1903b7273e78921e22a475f1dae5ebaae
Fix alertmanager API path.

Change-Id: Iea6059decb121c7e75c1828406c4e0b3f2fc1c5d
Compact everything to the same sample group size.

Change-Id: Ibb4f3a5d76173d64de916ef1eb41ab5d7900c97b
Merge "Compact everything to the same sample group size."