use of com.netflix.servo.monitor.MaxGauge in project incubator-servicecomb-java-chassis by apache.
the class MonitorManager method getMaxGauge.
public MaxGauge getMaxGauge(String name, String... tags) {
validateMonitorNameAndTags(name, tags);
return maxGauges.computeIfAbsent(getMonitorKey(name, tags), f -> {
MaxGauge maxGauge = new MaxGauge(getConfig(name, tags));
basicMonitorRegistry.register(maxGauge);
return maxGauge;
});
}
use of com.netflix.servo.monitor.MaxGauge in project tutorials by eugenp.
the class MetricTypeTest method givenMaxGauge_whenUpdateMultipleTimes_thenMaxReturned.
@Test
public void givenMaxGauge_whenUpdateMultipleTimes_thenMaxReturned() {
MaxGauge gauge = new MaxGauge(MonitorConfig.builder("test").build());
assertEquals(0, gauge.getValue().intValue());
gauge.update(4);
assertEquals(4, gauge.getCurrentValue(0));
gauge.update(1);
assertEquals(4, gauge.getCurrentValue(0));
}