fix recursion trap

This commit is contained in:
Jonathan Shook 2023-09-08 20:07:52 -05:00
parent 13660d7123
commit a8e74e5b86
3 changed files with 2 additions and 8 deletions

View File

@ -243,10 +243,4 @@ public class MapLabels implements NBLabels {
for (int i = 0; i < labelsAndValues.length; i+=2) childLabels.put(labelsAndValues[i].toString(), labelsAndValues[i + 1].toString()); for (int i = 0; i < labelsAndValues.length; i+=2) childLabels.put(labelsAndValues[i].toString(), labelsAndValues[i + 1].toString());
return childLabels; return childLabels;
} }
@Override
public NBLabels getLabels() {
return this;
}
} }

View File

@ -35,7 +35,7 @@ import java.util.function.Function;
* since these elements will be consulted frequently, such as when rendering metrics values. * since these elements will be consulted frequently, such as when rendering metrics values.
* </P> * </P>
*/ */
public interface NBLabels extends NBLabeledElement { public interface NBLabels {
/** /**
* Create a string representation of the label data, including only the values. * Create a string representation of the label data, including only the values.

View File

@ -57,7 +57,7 @@ public class RelevancyMeasures implements NBLabeledElement {
public RelevancyMeasures addFunction(RelevancyFunction... f) { public RelevancyMeasures addFunction(RelevancyFunction... f) {
for (RelevancyFunction function : f) { for (RelevancyFunction function : f) {
this.functions.add(function); this.functions.add(function);
DoubleSummaryGauge gauge = ActivityMetrics.summaryGauge(parent.getLabels().and(function.getLabels()), function.getUniqueName()); DoubleSummaryGauge gauge = ActivityMetrics.summaryGauge(this, function.getUniqueName());
this.gauges.add(gauge); this.gauges.add(gauge);
} }
return this; return this;