Conversation
sjaanus
commented
Dec 15, 2025
Comment on lines
+27
to
+34
| counters.values().stream() | ||
| .map(CounterImpl::collect) | ||
| .filter(m -> !m.getSamples().isEmpty()) | ||
| .forEach(collected::add); | ||
| gauges.values().stream() | ||
| .map(GaugeImpl::collect) | ||
| .filter(m -> !m.getSamples().isEmpty()) | ||
| .forEach(collected::add); |
Contributor
Author
There was a problem hiding this comment.
Found out that filtering out empty samples was missing.
Collaborator
Pull Request Test Coverage Report for Build 20264911164Details
💛 - Coveralls |
sjaanus
commented
Dec 15, 2025
Comment on lines
+40
to
+46
| new CollectedMetric( | ||
| "labeled_counter", | ||
| "with labels", | ||
| MetricType.COUNTER, | ||
| List.of(sample(Map.of("foo", "bar"), 5L))); | ||
|
|
||
| assertThat(metrics).containsExactly(expected); |
Contributor
Author
There was a problem hiding this comment.
This seems just formatting
sjaanus
commented
Dec 15, 2025
Comment on lines
+82
to
+85
| assertThat(result.getName()).isEqualTo("multi_label"); | ||
| assertThat(result.getSamples()) | ||
| .containsExactlyInAnyOrder( | ||
| sample(Map.of("a", "x"), 1L), sample(Map.of("b", "y"), 2L), sample(3L)); | ||
| .containsExactlyInAnyOrder( | ||
| sample(Map.of("a", "x"), 1L), sample(Map.of("b", "y"), 2L), sample(3L)); |
sjaanus
commented
Dec 15, 2025
| public void should_return_zero_value_when_empty() { | ||
| InMemoryMetricRegistry registry = new InMemoryMetricRegistry(); | ||
| registry.counter(new MetricOptions("noop_counter", "noop")); | ||
| registry.gauge(new MetricOptions("noop_gauge", "noop")); |
Contributor
Author
There was a problem hiding this comment.
This tests that gauge does not have zero default value.
kwasniew
reviewed
Dec 15, 2025
| private final String help; | ||
| private final ConcurrentHashMap<String, Long> values = new ConcurrentHashMap<>(); | ||
|
|
||
| GaugeImpl(String name, String help) { |
Contributor
There was a problem hiding this comment.
in Node we accept MetricOptions that has 3 fields. why do we have 2 params here instead of the object param and how can we pass labelNames in the constructor as Node allows?
kwasniew
approved these changes
Dec 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gauge implementation. Next is histogram.