From 520cb5fde3c26fe523f4c9adc944da8ddbd894d9 Mon Sep 17 00:00:00 2001 From: Johannes Eschrig Date: Sun, 7 Jun 2020 13:41:22 +0200 Subject: [PATCH] Adherence to micrometer naming conventions --- .../submission/controller/SubmissionController.java | 6 +++--- .../server/services/submission/monitoring/BatchCounter.java | 2 +- .../submission/monitoring/SubmissionControllerMonitor.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/submission/src/main/java/app/coronawarn/server/services/submission/controller/SubmissionController.java b/services/submission/src/main/java/app/coronawarn/server/services/submission/controller/SubmissionController.java index 44ffa8bd29..72889428e4 100644 --- a/services/submission/src/main/java/app/coronawarn/server/services/submission/controller/SubmissionController.java +++ b/services/submission/src/main/java/app/coronawarn/server/services/submission/controller/SubmissionController.java @@ -178,10 +178,10 @@ private void updateFakeDelay(long realRequestDuration) { } /** - * Gets the current fake delay. Used for monitoring. + * Gets the current fake delay in seconds. Used for monitoring. * @return the current fake delay */ - public Double getFakeDelay() { - return fakeDelay; + public Double getFakeDelayInSeconds() { + return fakeDelay / 1000.; } } diff --git a/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/BatchCounter.java b/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/BatchCounter.java index a0db3f0f41..cfce087de4 100644 --- a/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/BatchCounter.java +++ b/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/BatchCounter.java @@ -29,7 +29,7 @@ */ public class BatchCounter { - private static final String SUBMISSION_CONTROLLER_REQUESTS_COUNTER_NAME = "submissionController.requests"; + private static final String SUBMISSION_CONTROLLER_REQUESTS_COUNTER_NAME = "submission_controller.requests"; private static final String SUBMISSION_CONTROLLER_REQUESTS_COUNTER_DESCRIPTION = "Counts requests to the Submission Controller."; diff --git a/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/SubmissionControllerMonitor.java b/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/SubmissionControllerMonitor.java index d739afe5a4..9779f0882a 100644 --- a/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/SubmissionControllerMonitor.java +++ b/services/submission/src/main/java/app/coronawarn/server/services/submission/monitoring/SubmissionControllerMonitor.java @@ -34,7 +34,7 @@ @Component @ConfigurationProperties(prefix = "services.submission.monitoring") public class SubmissionControllerMonitor { - private static final String SUBMISSION_CONTROLLER_CURRENT_FAKE_DELAY = "submissionController.fakeDelay"; + private static final String SUBMISSION_CONTROLLER_CURRENT_FAKE_DELAY = "submission_controller.fake_delay_seconds"; private final MeterRegistry meterRegistry; @@ -79,7 +79,7 @@ private void initializeCounters() { */ public void initializeGauges(SubmissionController submissionController) { Gauge.builder(SUBMISSION_CONTROLLER_CURRENT_FAKE_DELAY, submissionController, - __ -> submissionController.getFakeDelay()) + __ -> submissionController.getFakeDelayInSeconds()) .description("The time that fake requests are delayed to make them indistinguishable from real requests.") .register(meterRegistry); }