diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-20 02:09:06 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-20 02:09:06 +0200 |
commit | 62d02deec6f21b62ad3c878aad4c0927b7bac1d0 (patch) | |
tree | 08a9b3a4164d95a6629b162edc84c37e79a624fb /kamon-core/src/test/scala/kamon | |
parent | 290a3c92da938182fe1157efff00d4589203e678 (diff) | |
download | Kamon-62d02deec6f21b62ad3c878aad4c0927b7bac1d0.tar.gz Kamon-62d02deec6f21b62ad3c878aad4c0927b7bac1d0.tar.bz2 Kamon-62d02deec6f21b62ad3c878aad4c0927b7bac1d0.zip |
+ core: provide sum and percentile functions in Histogram.Snapshot, closes #85
Diffstat (limited to 'kamon-core/src/test/scala/kamon')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala index cefdf0f4..c3060d4a 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala @@ -57,7 +57,7 @@ class HistogramSpec extends WordSpec with Matchers { } "produce a snapshot" which { - "supports min, max and numberOfMeasurements operations" in new HistogramFixture { + "supports min, max, percentile, sum and numberOfMeasurements operations" in new HistogramFixture { histogram.record(100) histogram.record(200, count = 200) histogram.record(300) @@ -67,7 +67,12 @@ class HistogramSpec extends WordSpec with Matchers { snapshot.min should equal(100L +- 1L) snapshot.max should equal(900L +- 9L) + snapshot.percentile(50.0D) should be(200) + snapshot.percentile(99.5D) should be(300) + snapshot.percentile(99.9D) should be(900) + snapshot.sum should be(41300) snapshot.numberOfMeasurements should be(203) + } "can be merged with another snapshot" in new MultipleHistogramFixture { |