diff options
author | Alexey Noskov <alexey.noskov@gmail.com> | 2015-09-26 18:03:15 +0300 |
---|---|---|
committer | Alexey Noskov <alexey.noskov@gmail.com> | 2015-09-26 20:49:38 +0300 |
commit | c4b58f26f43f3767633d9c06c9a65d6549093e35 (patch) | |
tree | 661b573c77357acffb99881a34a3e547808c670b /kamon-system-metrics/src/test/scala | |
parent | 6e07de4432c587a10c2ee27a5289898c722d0078 (diff) | |
download | Kamon-c4b58f26f43f3767633d9c06c9a65d6549093e35.tar.gz Kamon-c4b58f26f43f3767633d9c06c9a65d6549093e35.tar.bz2 Kamon-c4b58f26f43f3767633d9c06c9a65d6549093e35.zip |
! system-metrics: Fix heap metrics update
Don't store reference to MemoryUsage object: it's immutable, instead store function extracting it from MemoryMXBean
Diffstat (limited to 'kamon-system-metrics/src/test/scala')
-rw-r--r-- | kamon-system-metrics/src/test/scala/kamon/metrics/SystemMetricsSpec.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kamon-system-metrics/src/test/scala/kamon/metrics/SystemMetricsSpec.scala b/kamon-system-metrics/src/test/scala/kamon/metrics/SystemMetricsSpec.scala index 7af704d5..452ee0c7 100644 --- a/kamon-system-metrics/src/test/scala/kamon/metrics/SystemMetricsSpec.scala +++ b/kamon-system-metrics/src/test/scala/kamon/metrics/SystemMetricsSpec.scala @@ -74,6 +74,20 @@ class SystemMetricsSpec extends BaseKamonSpec("system-metrics-spec") with Redire memoryMetrics.gauge("non-heap-committed").get.numberOfMeasurements should be > 0L } + "record correctly updatable values for heap metrics" in { + Thread.sleep(3000) + + val data = new Array[Byte](20 * 1024 * 1024) // 20 Mb of data + + Thread.sleep(3000) + + val memoryMetrics = takeSnapshotOf("jmx-memory", "system-metric") + val heapUsed = memoryMetrics.gauge("heap-used").get + + heapUsed.max should be > heapUsed.min + data.size should be > 0 // Just for data usage + } + "record daemon, count and peak jvm threads metrics" in { val threadsMetrics = takeSnapshotOf("threads", "system-metric") |