Package com.codingchili.core.metrics
Class MetricCollector
java.lang.Object
com.codingchili.core.metrics.MetricCollector
Implementation of metric collection backed by micrometer.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMetricCollector(CoreContext core, MetricSettings settings, String registryName)
-
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.json.JsonObject
metadata()
void
onMetricsSnapshot(io.vertx.core.json.JsonObject metrics)
com.codahale.metrics.MetricRegistry
registry()
settings()
io.vertx.core.Future<io.vertx.core.json.JsonObject>
snapshot()
Produces a report of the current metric snapshot.
-
Field Details
-
PROCESS_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
MetricCollector
- Parameters:
core
- the context to collect metrics from.settings
- settings for the metric collector.registryName
- the name of the metric registry to use.
-
-
Method Details
-
onMetricsSnapshot
public void onMetricsSnapshot(io.vertx.core.json.JsonObject metrics)- Parameters:
metrics
- log a metrics snapshot.
-
metadata
public io.vertx.core.json.JsonObject metadata()- Returns:
- metadata for the metric collector, this data will be included in all metric reports.
-
type
- Parameters:
type
- sets the given type as metadata.- Returns:
- fluent.
-
settings
- Returns:
- the settings for this collector.
-
registry
public com.codahale.metrics.MetricRegistry registry()- Returns:
- the metrics registry used to collect metrics. Can be used to add custom generators.
-
snapshot
public io.vertx.core.Future<io.vertx.core.json.JsonObject> snapshot()Produces a report of the current metric snapshot.- Returns:
- a generated json report with the target fields.
-