basic metric system with metric stream subscription and logarithmically-bucketed histograms

Summary:
Simple metric system that supports histograms, counters, and gauges.

Histogram values are passed through a logarithmic bucketing function that loses up to 1% of precision for values greater than +/- 0.51.  This makes sampling unnecessary for highly-clustered values, such as latency distributions.  This allows for histograms that are representative of very large data sets such as latency distributions of a frequent RPC that occurs across tens of thousands of machines.

Counters export:
  <name>: the total count
  <rate>: the growth of this counter within this interval
Histograms export:
  <name>_min: minimum
  <name>_max: maximum
  <name>_{50,75,90,95,99,99.9,99.99}: various percentiles
  <name>_count: occurrences in this period
  <name>_sum: sum of values in this period
  <name>_avg: mean of values during this period
  <name>_agg_count: total occurrences seen during the life of this histogram
  <name>_agg_sum: total sum of values seen during the life of this histogram
  <name>_agg_avg: aggregate mean over the life of this histogram
Gauges export:
  <name>: value returned by callback function for this gauge when called at the end of the interval

General Usage:
  // Initialize collection goroutines of the default MetricSystem.
  Metrics.Start()
  // Subscribe to generated metrics. Always used buffered channels, as
  // the MetricSystem will not block on a subscriber and will forget about it
  // after 3 blocking attempts in a row.
  myMetricStream := make(chan *ProcessedMetricSet, 2)
  Metrics.SubscribeToProcessedMetrics(myMetricStream)
  ...
  // Create metrics.
  timeToken := Metrics.StartTimer("submit_metrics")
  Metrics.Counter("range_splits", 1)
  Metrics.Histogram("some_ipc_latency", 123)
  Metrics.StopTimer(timeToken)
  ...
  // Eventually (at the beginning of each minute for the default MetricSystem)
  // receive processed metrics in another component, perhaps a component
  // that allows a remote process to "plug-in" to an instance's generated
  // metrics for real-time analysis, or maybe a component that stores
  // metrics in Cockroach itself for future analysis.  This can also
  // facilitate submission to Graphite/OpenTSDB/Logstash if desired.
  for processedMetricSet := range myMetricStream {
    // processedMetricSet.Time is a time.Time corresponding to the period for these metrics
    // processedMetricSet.Metrics is a map[string]float64 containing results
  }

Test Plan: go test

Reviewers: spencerkimball, andybons, wkm, Tobias, strangemonad, bdarnell

Reviewed By: bdarnell

Subscribers: bdarnell, team

Differential Revision: http://phabricator.cockroachdb.org/D96