diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-26 19:51:44 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-26 19:51:44 +0100 |
commit | 491c51e745ab2c5dc1dbc080feadbbc9c2e60f75 (patch) | |
tree | f9a477ff2415c8b3f39761d3c865a858067c4e8c /kamon-system-metrics/src/main/scala/kamon/system | |
parent | 926fea09f9e463425ec86649e5e75e5abd907066 (diff) | |
download | Kamon-491c51e745ab2c5dc1dbc080feadbbc9c2e60f75.tar.gz Kamon-491c51e745ab2c5dc1dbc080feadbbc9c2e60f75.tar.bz2 Kamon-491c51e745ab2c5dc1dbc080feadbbc9c2e60f75.zip |
+ sysmetrics: report total and buffers+cache system memory
Diffstat (limited to 'kamon-system-metrics/src/main/scala/kamon/system')
-rw-r--r-- | kamon-system-metrics/src/main/scala/kamon/system/sigar/MemoryMetrics.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kamon-system-metrics/src/main/scala/kamon/system/sigar/MemoryMetrics.scala b/kamon-system-metrics/src/main/scala/kamon/system/sigar/MemoryMetrics.scala index ab7fcd88..85d55862 100644 --- a/kamon-system-metrics/src/main/scala/kamon/system/sigar/MemoryMetrics.scala +++ b/kamon-system-metrics/src/main/scala/kamon/system/sigar/MemoryMetrics.scala @@ -13,16 +13,21 @@ import org.hyperic.sigar.Sigar */ class MemoryMetrics(instrumentFactory: InstrumentFactory) extends GenericEntityRecorder(instrumentFactory) with SigarMetric { val used = histogram("memory-used", Memory.Bytes) + val cached = histogram("memory-cache-and-buffer", Memory.Bytes) val free = histogram("memory-free", Memory.Bytes) + val total = histogram("memory-total", Memory.Bytes) val swapUsed = histogram("swap-used", Memory.Bytes) val swapFree = histogram("swap-free", Memory.Bytes) def update(sigar: Sigar): Unit = { val mem = sigar.getMem val swap = sigar.getSwap + val cachedMemory = if(mem.getActualFree > mem.getFree) mem.getActualFree - mem.getFree else 0L - used.record(mem.getUsed) - free.record(mem.getFree) + used.record(mem.getActualUsed) + free.record(mem.getActualFree) + cached.record(cachedMemory) + total.record(mem.getTotal) swapUsed.record(swap.getUsed) swapFree.record(swap.getFree) } |