Permalink
Browse files

Merge branch 'release/2.0.0-BETA16'

  • Loading branch information...
2 parents 7b64036 + 35e62ff commit 953a93b9b9e2da6259fb1f4afa0b38e0c6fa42b4 @codahale codahale committed Aug 23, 2011
Showing with 204 additions and 197 deletions.
  1. +6 −0 CHANGELOG.md
  2. +2 −1 CONTRIBUTORS.md
  3. +2 −2 README.md
  4. +1 −1 metrics-core/pom.xml
  5. +1 −1 metrics-core/src/main/java/com/yammer/metrics/core/VirtualMachineMetrics.java
  6. +6 −6 metrics-core/src/test/scala/com/yammer/metrics/core/tests/CounterMetricSpec.scala
  7. +1 −1 metrics-core/src/test/scala/com/yammer/metrics/core/tests/GaugeMetricSpec.scala
  8. +18 −18 metrics-core/src/test/scala/com/yammer/metrics/core/tests/HistogramMetricSpec.scala
  9. +3 −3 metrics-core/src/test/scala/com/yammer/metrics/core/tests/MeterMetricSpec.scala
  10. +33 −31 metrics-core/src/test/scala/com/yammer/metrics/core/tests/TimerMetricSpec.scala
  11. +48 −48 metrics-core/src/test/scala/com/yammer/metrics/stats/tests/EWMASpec.scala
  12. +9 −9 metrics-core/src/test/scala/com/yammer/metrics/stats/tests/ExponentiallyDecayingSampleSpec.scala
  13. +6 −6 metrics-core/src/test/scala/com/yammer/metrics/stats/tests/UniformSampleSpec.scala
  14. +1 −1 metrics-ehcache/pom.xml
  15. +1 −1 metrics-graphite/pom.xml
  16. +1 −1 metrics-guice/pom.xml
  17. +3 −3 metrics-guice/src/test/scala/com/yammer/metrics/guice/tests/GaugeSpec.scala
  18. +5 −5 metrics-guice/src/test/scala/com/yammer/metrics/guice/tests/MeteredSpec.scala
  19. +5 −5 metrics-guice/src/test/scala/com/yammer/metrics/guice/tests/TimedSpec.scala
  20. +1 −1 metrics-jetty/pom.xml
  21. +1 −1 metrics-log4j/pom.xml
  22. +1 −1 metrics-logback/pom.xml
  23. +36 −36 metrics-logback/src/test/scala/com/yammer/metrics/logback/LogbackInstrumentedAppenderSpec.scala
  24. +1 −1 metrics-scala_2.9.0-1/pom.xml
  25. +1 −1 metrics-scala_2.9.0-1/pom_2.8.1.xml
  26. +3 −4 metrics-scala_2.9.0-1/src/test/scala/com/yammer/metrics/tests/CounterSpec.scala
  27. +3 −4 metrics-scala_2.9.0-1/src/test/scala/com/yammer/metrics/tests/MeterSpec.scala
  28. +2 −2 metrics-scala_2.9.0-1/src/test/scala/com/yammer/metrics/tests/TimerSpec.scala
  29. +1 −1 metrics-servlet/pom.xml
  30. +2 −2 pom.xml
View
@@ -1,3 +1,9 @@
+v2.0.0-BETA16: Aug 23 2011
+==========================
+
+* Fixed a bug in GC monitoring.
+
+
v2.0.0-BETA15: Aug 15 2011
==========================
View
@@ -2,8 +2,9 @@ Many Many Thanks To
===================
* Bruce Mitchener (@waywardmonkeys)
-* Gerolf Seitz (@seitz)
+* Ciamac Moallemi (@ciamac)
* Cliff Moon (@cliffmoon)
+* Gerolf Seitz (@seitz)
* James Casey (@jamesc)
* JD Maturen (@sku)
* John Ewart (@johnewart)
View
@@ -35,13 +35,13 @@ How To Use
<dependency>
<groupId>com.yammer.metrics</groupId>
<artifactId>metrics-core</artifactId>
- <version>2.0.0-BETA15</version>
+ <version>2.0.0-BETA16</version>
</dependency>
<!-- if you want the Scala façade library -->
<dependency>
<groupId>com.yammer.metrics</groupId>
<artifactId>metrics-scala_${scala.version}</artifactId>
- <version>2.0.0-BETA15</version>
+ <version>2.0.0-BETA16</version>
</dependency>
</dependencies>
```
View
@@ -7,7 +7,7 @@
<parent>
<groupId>com.yammer.metrics</groupId>
<artifactId>metrics-parent</artifactId>
- <version>2.0.0-BETA15</version>
+ <version>2.0.0-BETA16</version>
</parent>
<groupId>com.yammer.metrics</groupId>
@@ -151,7 +151,7 @@ public static long daemonThreadCount() {
public static Map<String, GarbageCollector> garbageCollectors() {
final Map<String, GarbageCollector> gcs = new HashMap<String, GarbageCollector>();
for (GarbageCollectorMXBean bean : getGarbageCollectorMXBeans()) {
- gcs.put(bean.getName(), new GarbageCollector(bean.getCollectionCount(), bean.getCollectionCount()));
+ gcs.put(bean.getName(), new GarbageCollector(bean.getCollectionCount(), bean.getCollectionTime()));
}
return gcs;
}
@@ -9,38 +9,38 @@ class CounterMetricSpec extends Spec {
val counter = new CounterMetric
@test def `starts at zero` = {
- counter.count must beEqualTo(0)
+ counter.count.must(be(0))
}
@test def `increments by one` = {
counter.inc()
- counter.count must beEqualTo(1)
+ counter.count.must(be(1))
}
@test def `increments by an arbitrary delta` = {
counter.inc(3)
- counter.count must beEqualTo(3)
+ counter.count.must(be(3))
}
@test def `decrements by one` = {
counter.dec()
- counter.count must beEqualTo(-1)
+ counter.count.must(be(-1))
}
@test def `decrements by an arbitrary delta` = {
counter.dec(3)
- counter.count must beEqualTo(-3)
+ counter.count.must(be(-3))
}
@test def `is zero after being cleared` = {
counter.inc(3)
counter.clear()
- counter.count must beEqualTo(0)
+ counter.count.must(be(0))
}
}
}
@@ -12,7 +12,7 @@ class GaugeMetricSpec extends Spec {
}
@test def `return a value` = {
- metric.value() must beEqualTo("woo")
+ metric.value().must(be("woo"))
}
}
@@ -11,35 +11,35 @@ class HistogramMetricSpec extends Spec {
val histogram = new HistogramMetric(new UniformSample(100))
@test def `has a count of 0` = {
- histogram.count must beEqualTo(0)
+ histogram.count.must(be(0))
}
@test def `has a max of 0` = {
- histogram.max must beEqualTo(0)
+ histogram.max.must(be(0))
}
@test def `has a min of 0` = {
- histogram.min must beEqualTo(0)
+ histogram.min.must(be(0))
}
@test def `has a mean of 0` = {
- histogram.mean must beCloseTo(0.0, 0.0)
+ histogram.mean.must(be(approximately(0.0, 0.0)))
}
@test def `has a standard deviation of 0` = {
- histogram.stdDev must beCloseTo(0.0, 0.0)
+ histogram.stdDev.must(be(approximately(0.0, 0.0)))
}
@test def `calculates percentiles` = {
val percentiles = histogram.percentiles(0.5, 0.75, 0.99)
- percentiles(0) must beCloseTo(0.0, 0.01)
- percentiles(1) must beCloseTo(0.0, 0.01)
- percentiles(2) must beCloseTo(0.0, 0.01)
+ percentiles(0).must(be(approximately(0.0, 0.01)))
+ percentiles(1).must(be(approximately(0.0, 0.01)))
+ percentiles(2).must(be(approximately(0.0, 0.01)))
}
@test def `has no values` = {
- histogram.values.toList must beEmpty
+ histogram.values.toList.must(be(empty))
}
}
@@ -48,35 +48,35 @@ class HistogramMetricSpec extends Spec {
(1 to 10000).foreach(histogram.update)
@test def `has a count of 10000` = {
- histogram.count must beEqualTo(10000)
+ histogram.count.must(be(10000))
}
@test def `has a max value of 10000` = {
- histogram.max must beEqualTo(10000)
+ histogram.max.must(be(10000))
}
@test def `has a min value of 1` = {
- histogram.min must beEqualTo(1)
+ histogram.min.must(be(1))
}
@test def `has a mean value of 5000.5` = {
- histogram.mean must beCloseTo(5000.5, 0.01)
+ histogram.mean.must(be(approximately(5000.5, 0.01)))
}
@test def `has a standard deviation of X` = {
- histogram.stdDev must beCloseTo(2886.89, 0.1)
+ histogram.stdDev.must(be(approximately(2886.89, 0.1)))
}
@test def `calculates percentiles` = {
val percentiles = histogram.percentiles(0.5, 0.75, 0.99)
- percentiles(0) must beCloseTo(5000.5, 0.01)
- percentiles(1) must beCloseTo(7500.75, 0.01)
- percentiles(2) must beCloseTo(9900.99, 0.01)
+ percentiles(0).must(be(approximately(5000.5, 0.01)))
+ percentiles(1).must(be(approximately(7500.75, 0.01)))
+ percentiles(2).must(be(approximately(9900.99, 0.01)))
}
@test def `has 10000 values` = {
- histogram.values.toList must beEqualTo((1 to 10000).toList)
+ histogram.values.toList.must(be((1 to 10000).map { java.lang.Long.valueOf(_) }.toList))
}
}
@@ -10,11 +10,11 @@ class MeterMetricSpec extends Spec {
val meter = MeterMetric.newMeter("thangs", TimeUnit.SECONDS)
@test def `has a count of zero` = {
- meter.count must beEqualTo(0)
+ meter.count.must(be(0))
}
@test def `has a mean rate of 0 events/sec` = {
- meter.meanRate must beEqualTo(0.0)
+ meter.meanRate.must(be(0.0))
}
}
@@ -23,7 +23,7 @@ class MeterMetricSpec extends Spec {
meter.mark(3)
@test def `has a count of three` = {
- meter.count must beEqualTo(3)
+ meter.count.must(be(3))
}
}
}
@@ -11,60 +11,60 @@ class TimerMetricSpec extends Spec {
val timer = new TimerMetric(TimeUnit.MILLISECONDS, TimeUnit.SECONDS)
@test def `has a duration unit` = {
- timer.durationUnit must be(TimeUnit.MILLISECONDS)
+ timer.durationUnit.must(be(TimeUnit.MILLISECONDS))
}
@test def `has a rate unit` = {
- timer.rateUnit must be(TimeUnit.SECONDS)
+ timer.rateUnit.must(be(TimeUnit.SECONDS))
}
@test def `has a max of zero` = {
- timer.max must beCloseTo(0.0, 0.001)
+ timer.max.must(be(approximately(0.0, 0.001)))
}
@test def `has a min of zero` = {
- timer.min must beCloseTo(0.0, 0.001)
+ timer.min.must(be(approximately(0.0, 0.001)))
}
@test def `has a mean of zero` = {
- timer.mean must beCloseTo(0.0, 0.001)
+ timer.mean.must(be(approximately(0.0, 0.001)))
}
@test def `has a count of zero` = {
- timer.count must beEqualTo(0)
+ timer.count.must(be(0))
}
@test def `has a standard deviation of zero` = {
- timer.stdDev must beCloseTo(0.0, 0.001)
+ timer.stdDev.must(be(approximately(0.0, 0.001)))
}
@test def `has a median/p95/p98/p99/p999 of zero` = {
val Array(median, p95, p98, p99, p999) = timer.percentiles(0.5, 0.95, 0.98, 0.99, 0.999)
- median must beCloseTo(0.0, 0.001)
- p95 must beCloseTo(0.0, 0.001)
- p98 must beCloseTo(0.0, 0.001)
- p99 must beCloseTo(0.0, 0.001)
- p999 must beCloseTo(0.0, 0.001)
+ median.must(be(approximately(0.0, 0.001)))
+ p95.must(be(approximately(0.0, 0.001)))
+ p98.must(be(approximately(0.0, 0.001)))
+ p99.must(be(approximately(0.0, 0.001)))
+ p999.must(be(approximately(0.0, 0.001)))
}
@test def `has a mean rate of zero` = {
- timer.meanRate must beCloseTo(0.0, 0.001)
+ timer.meanRate.must(be(approximately(0.0, 0.001)))
}
@test def `has a one-minute rate of zero` = {
- timer.oneMinuteRate must beCloseTo(0.0, 0.001)
+ timer.oneMinuteRate.must(be(approximately(0.0, 0.001)))
}
@test def `has a five-minute rate of zero` = {
- timer.fiveMinuteRate must beCloseTo(0.0, 0.001)
+ timer.fiveMinuteRate.must(be(approximately(0.0, 0.001)))
}
@test def `has a fifteen-minute rate of zero` = {
- timer.fifteenMinuteRate must beCloseTo(0.0, 0.001)
+ timer.fifteenMinuteRate.must(be(approximately(0.0, 0.001)))
}
@test def `has no values` = {
- timer.values.toList must beEmpty
+ timer.values.toList.must(be(empty))
}
}
@@ -77,36 +77,36 @@ class TimerMetricSpec extends Spec {
timer.update(40, TimeUnit.MILLISECONDS)
@test def `records the count` = {
- timer.count must beEqualTo(5)
+ timer.count.must(be(5))
}
@test def `calculates the minimum duration` = {
- timer.min must beCloseTo(10.0, 0.001)
+ timer.min.must(be(approximately(10.0, 0.001)))
}
@test def `calculates the maximum duration` = {
- timer.max must beCloseTo(40.0, 0.001)
+ timer.max.must(be(approximately(40.0, 0.001)))
}
@test def `calculates the mean duration` = {
- timer.mean must beCloseTo(24.0, 0.001)
+ timer.mean.must(be(approximately(24.0, 0.001)))
}
@test def `calculates the standard deviation` = {
- timer.stdDev must beCloseTo(11.401, 0.001)
+ timer.stdDev.must(be(approximately(11.401, 0.001)))
}
@test def `calculates the median/p95/p98/p99/p999` = {
val Array(median, p95, p98, p99, p999) = timer.percentiles(0.5, 0.95, 0.98, 0.99, 0.999)
- median must beCloseTo(20.0, 0.001)
- p95 must beCloseTo(40.0, 0.001)
- p98 must beCloseTo(40.0, 0.001)
- p99 must beCloseTo(40.0, 0.001)
- p999 must beCloseTo(40.0, 0.001)
+ median.must(be(approximately(20.0, 0.001)))
+ p95.must(be(approximately(40.0, 0.001)))
+ p98.must(be(approximately(40.0, 0.001)))
+ p99.must(be(approximately(40.0, 0.001)))
+ p999.must(be(approximately(40.0, 0.001)))
}
@test def `has a series of values` = {
- timer.values.toSet must beEqualTo(Set(10, 20, 20, 30, 40))
+ timer.values.toSet.must(be(Set[java.lang.Double](10, 20, 20, 30, 40)))
}
}
@@ -116,23 +116,25 @@ class TimerMetricSpec extends Spec {
timer.update(0, TimeUnit.NANOSECONDS)
@test def `calculates the standard deviation without overflowing` = {
- timer.stdDev must beCloseTo(75485.05, 0.01)
+ timer.stdDev.must(be(approximately(75485.05, 0.01)))
}
}
class `Timing Callable instances` {
val timer = new TimerMetric(TimeUnit.MILLISECONDS, TimeUnit.SECONDS)
@test def `records the duration of the Callable#call()` = {
- time must eventually(beCloseTo(50.0, 2))
+ eventually {
+ time
+ }.must(be(approximately(50.0, 2)))
}
@test def `returns the result of the callable` = {
timer.time(new Callable[String] {
def call = {
"woo"
}
- }) must beEqualTo("woo")
+ }).must(be("woo"))
}
private def time = {
Oops, something went wrong.

0 comments on commit 953a93b

Please sign in to comment.