From 6290b63b30c97b7da0df02559d8efc61c85ccbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kr=C3=A1l?= <53821852+im-konge@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:17:03 +0200 Subject: [PATCH] Add getValue() method to Counter type metric (#177) ## Description The `Counter` metric type is the only one missing the `getValue()` method, which is used for obtaining the `value` parameter from the Counter object. This PR adds it to the code. ## Type of Change * Bug fix (non-breaking change which fixes an issue) ## Checklist - [X] My code follows the style guidelines of this project - [X] I have performed a self-review of my own code - [X] I have commented my code, particularly in hard-to-understand areas - [X] I have made corresponding changes to the documentation - [X] My changes generate no new warnings - [X] I have added tests that prove my fix is effective or that my feature works - [X] New and existing unit/integration tests pass locally with my changes --- .../main/java/io/skodjob/testframe/metrics/Counter.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test-frame-metrics-collector/src/main/java/io/skodjob/testframe/metrics/Counter.java b/test-frame-metrics-collector/src/main/java/io/skodjob/testframe/metrics/Counter.java index 79d2faf..ebba5a4 100644 --- a/test-frame-metrics-collector/src/main/java/io/skodjob/testframe/metrics/Counter.java +++ b/test-frame-metrics-collector/src/main/java/io/skodjob/testframe/metrics/Counter.java @@ -24,6 +24,15 @@ public Counter(String name, Map labels, double value) { this.value = value; } + /** + * Returns value + * + * @return value + */ + public double getValue() { + return value; + } + /** * Metric string representation *