codahale/hdrhistogram — pull request #5 by tylertreat (2014-12-21 02:03:11+00:00)
Title: Export/Import Histograms

Thanks for the golang port, super useful.

This is a stab at addressing what was discussed in issue #1. I think the consensus from that discussion was to keep the API simple. Any kind of `Histogram` serialization should be deferred to users of the library, but a way to export a view of the `Histogram` should be provided.

This introduces a `Snapshot` which is produced on `Export`. This allows users to do what they want with it and later reconstruct a `Histogram` from it using `Import`. Another item is the `Equals` method which is used to compare a `Histogram` for equality.

Also changed `New` so that the sigfigs argument is an `int64`, which reflects the type on the underlying `Histogram`.