rcrowley / go-metrics

Go port of Coda Hale's Metrics library
Other
3.43k stars 493 forks source link

Document the argument expected for percentile-related functions #194

Open vincentbernat opened 7 years ago

vincentbernat commented 7 years ago

Some people (notably me) would expect to provide a percentile as the P-th percentile. For example, to get the 75th percentile, I would use m.Percentile(75). However, the correct use is m.Percentile(0.75). This commit just adds an example to each percentile-related function to avoid this error.

vincentbernat commented 7 years ago

A complementary resolution would be to panic when value is not between 0 and 1.