anachronistic/counter — pull request #2 by anachronistic (2014-06-08 19:52:26+00:00)
Title: Stable sort the stats

# Stable sort the stats

Using a map instead of a list means the output order for counters is no longer guaranteed; this sorts the keys alphabetically and produces stable output.

```
$ go run stable.go
METRIC VALUE
alpha 100
beta 2
charlie 3
$ go run stable.go
METRIC VALUE
alpha 100
beta 2
charlie 3
$ go run stable.go
METRIC VALUE
alpha 100
beta 2
charlie 3
```