A set of additional metrics complementing Dropwizards metrics-jvm.
- get "real" memory usage of the JVM beyond its managed parts
- get ahold of that info from within the JVM in environments where you can't scrape from the outside (e.g. PaaS)
<dependency>
<groupId>io.github.mweirauch</groupId>
<artifactId>metrics-jvm-extras</artifactId>
<version>x.y.z</version>
</dependency>
metrics.register("jvm.process.mem", new ProcessMemoryUsageGaugeSet());
metrics.register("jvm.process.fds.count", new FileDescriptorCountGauge());
metrics.register("jvm.process.uptime", new UptimeGauge());
The ProcessMemoryUsageGaugeSet
reads values from /proc/self/smaps
.
Please note that procfs
is only available on Linux-based systems.
vss
: Virtual set size. The amount of virtual memory the process can access. Mostly useles, but included for completeness sake.rss
: Resident set size. The amount of process memory currently in RAM.pss
: Proportional set size. The amount of process memory currently in RAM, accounting for shared pages among processes. This metric is the most accurate in terms of "real" memory usage.swap
: The amount of process memory paged out to swap.swappss
: The amount of process memory paged out to swap accounting for shared memory among processes. Since Linux 4.3. Will return-1
if your kernel is older. As withpss
, the most accurate metric to watch.
Deprecated in favour of ProcessMemoryUsageGaugeSet
. Returns the very same
values. Will be removed.
Provides the count of open file descriptors in use by the JVM process.
Provides uptime in ms
.
- procfs data is cached for
100ms
in order to relief the filesystem pressure whenMetric
s based on this data are queried by the registry one after another on collection run.
- CPU usage details
- JVM Native Memory Tracking details