From 5a2b37b98c2854ca8affa5ff37fa704c3a972fbf Mon Sep 17 00:00:00 2001 From: EddeCCC Date: Tue, 19 Nov 2024 15:21:13 +0100 Subject: [PATCH] little refactor --- .../agent/instrumentation/state/InstrumentationState.java | 2 +- .../gepard/agent/internal/metrics/MetricFactory.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/instrumentation/state/InstrumentationState.java b/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/instrumentation/state/InstrumentationState.java index b8be585..be10828 100644 --- a/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/instrumentation/state/InstrumentationState.java +++ b/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/instrumentation/state/InstrumentationState.java @@ -133,7 +133,7 @@ private void updateMethodHooks( /** Sets up self-monitoring to record the amount of instrumented classes. */ private void setUpSelfMonitoring() { Consumer callback = - (measurment) -> measurment.record(activeInstrumentations.estimatedSize()); + (measurement) -> measurement.record(activeInstrumentations.estimatedSize()); MetricFactory.createObservableDoubleGauge("inspectit.self.instrumented-classes", callback); } } diff --git a/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/internal/metrics/MetricFactory.java b/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/internal/metrics/MetricFactory.java index 0a74d50..a8aabb6 100644 --- a/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/internal/metrics/MetricFactory.java +++ b/inspectit-gepard-agent/src/main/java/rocks/inspectit/gepard/agent/internal/metrics/MetricFactory.java @@ -3,7 +3,7 @@ import io.opentelemetry.api.metrics.ObservableDoubleGauge; import io.opentelemetry.api.metrics.ObservableDoubleMeasurement; -import io.opentelemetry.sdk.metrics.export.MetricExporter; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; import java.util.function.Consumer; import rocks.inspectit.gepard.agent.internal.otel.OpenTelemetryAccessor; @@ -13,9 +13,8 @@ public class MetricFactory { private MetricFactory() {} /** - * Creates an observable gauge metric. This gauge will record a value via calling the callback - * function everytime it is observed. The gauge is observed when the OpenTelemetry {@link - * MetricExporter} exports data. + * Creates an observable gauge metric. This gauge will record a measurement via calling the + * callback function everytime it is observed by the {@link PeriodicMetricReader}. * * @param name the name of the gauge * @param callback the callback function to record a measurement