guardian/frontend — pull request #5414 by janua (2014-08-06 15:45:06+00:00)
Title: Better press latency metrics

This is the start of the new metrics work.
This pull request is only the initial metrics for the front latency; it is work in progress with a bit of work still to do, and this is not the final implementation or interface.

I mainly want this out to see how it performs before doing the wider metric work.

#### Nice Metrics!
These metrics now work properly in `cloudwatch`. It is really nice to see. You get proper `Sum`, `Average`, `Minimum`, `Maximum` and `Data Samples`.

#### Future Metrics
The way the current metrics work is that all data points are rounded to the nearest minute when pushed. This makes it impossible to get the full features of `cloudwatch`.
These latency metrics just add the date (and also the Unit type), in which you then get better metrics in `cloudwatch`.
The way I would imagine future metrics to work would be to have both of these; One type of metric that stores each `DataPoint` along with a `DateTime`, and another metric type that works the way the current metrics work by rounding to the nearest minute on upload.
We don't want to be storing a `DateTime` for each `DataPoint` in some instances, for example a basic count.

@robertberry