You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The listener receives a Gauge and is necessary to persist in MetricManager. How can I update a Gauge inside MetricManager? At MetricRegistryImpl#register an exception "A metric named ... already exists" is thrown if I try to call MetricManager.register with the same metricName.
CpuUsageService cpuUsageService = new CpuUsageServiceImpl(100L, 500L);
cpuUsageService.addListener("foo.bar", cpu -> {
SortedMap<MetricName, Gauge> gauges = MetricManager.getIMetricManager().getGauges(DUBBO_GROUP, MetricFilter.ALL);
Gauge<Float> cpuUser = gauges.get(new MetricName("dubbo.cpu." + invoker.getUrl().getHost(), MetricLevel.MAJOR));
if (cpuUser == null) {
MetricName metricName = new MetricName("dubbo.cpu." + invoker.getUrl().getHost(), MetricLevel.MAJOR);
MetricManager.register(DUBBO_GROUP, metricName, cpu);
} else {
//TODO: I need to update the Gauge here
}
});
The text was updated successfully, but these errors were encountered:
The listener receives a Gauge and is necessary to persist in MetricManager. How can I update a Gauge inside MetricManager? At MetricRegistryImpl#register an exception "A metric named ... already exists" is thrown if I try to call MetricManager.register with the same metricName.
The text was updated successfully, but these errors were encountered: