public interface JvmMetrics
Typically we want the standard JVM metrics and either Logback or Log4J metrics and this provides a relatively easy way to register those.
MetricManager.jvmMetrics()
.withReportAlways()
.registerStandardJvmMetrics()
.registerLogbackMetrics();
| Modifier and Type | Method and Description |
|---|---|
JvmMetrics |
registerJvmGCMetrics()
Register metrics for GC activity.
|
JvmMetrics |
registerJvmMemoryMetrics()
Register metrics for heap and non-heap memory.
|
JvmMetrics |
registerJvmOsLoadMetric()
Register a metric for OS load.
|
JvmMetrics |
registerJvmProcessMemoryMetrics()
Register metrics for VMRSS process memory (if supported on the platform).
|
JvmMetrics |
registerJvmThreadMetrics()
Register metrics for the total number of threads allocated.
|
JvmMetrics |
registerLog4JMetrics()
Register metrics for Log4J error and warning messages.
|
JvmMetrics |
registerLogbackMetrics()
Register metrics for Logback error and warning messages.
|
JvmMetrics |
registerStandardJvmMetrics()
Register all the standard JVM metrics - memory, threads, gc, os load and process memory.
|
JvmMetrics |
withLogMetricName(String errorMetricName,
String warnMetricName)
Set the names of the metrics for logging errors and warnings.
|
JvmMetrics |
withReportAlways()
Set to report the metrics irrespective of whether the metric has changed.
|
JvmMetrics |
withReportChangesOnly()
Set to only report when the metrics change.
|
JvmMetrics withReportChangesOnly()
JvmMetrics withReportAlways()
For metrics that generally don't change like max memory or don't change as frequently these metrics will be reported every time.
JvmMetrics registerStandardJvmMetrics()
JvmMetrics registerJvmOsLoadMetric()
JvmMetrics registerJvmGCMetrics()
JvmMetrics registerJvmThreadMetrics()
JvmMetrics registerJvmMemoryMetrics()
JvmMetrics registerJvmProcessMemoryMetrics()
JvmMetrics withLogMetricName(String errorMetricName, String warnMetricName)
When not set these default to app.log.error and app.log.warn respectively.
JvmMetrics registerLogbackMetrics()
JvmMetrics registerLog4JMetrics()
Copyright © 2019. All rights reserved.