Skip to content

Commit

Permalink
Add getValue() method to Counter type metric (#177)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
im-konge authored Aug 30, 2024
1 parent d539b9a commit 6290b63
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ public Counter(String name, Map<String, String> labels, double value) {
this.value = value;
}

/**
* Returns value
*
* @return value
*/
public double getValue() {
return value;
}

/**
* Metric string representation
*
Expand Down

0 comments on commit 6290b63

Please sign in to comment.