public static Counter getLeaderSendBeatFailedException() { return Metrics.counter("nacos_exception", "module", "naming", "name", "leaderSendBeatFailed"); } }
public static Timer getConfigRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "config", "method", method, "url", url, "code", code); }
@Before public void setUp() { Metrics.addRegistry(simpleMeterRegistry); Schedulers.enableMetrics(); }
@After public void tearDown() { Schedulers.disableMetrics(); Metrics.globalRegistry.forEachMeter(Metrics.globalRegistry::remove); Metrics.removeRegistry(simpleMeterRegistry); }
@Override public boolean execute() { long ts = currentTimeMillis(); boolean executed = delegate.execute(); Metrics.gauge(gaugeName(), (currentTimeMillis() - ts) / 1000L); return executed; }
public void shouldReportRuntime() { // given: when(jobRunnable.getJobDefinition()).thenReturn(someJobDefinition("BAR")); // when: jobService.startAsyncJob("BAR"); // then: assertThat(Metrics.summary("gauge.jobs.runtime.bar").totalAmount(), is(greaterThan(0.0d))); }
@Inject public PrometheusMeterRegistryProvider(CollectorRegistry registry) { prometheusMeterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT, registry, Clock.SYSTEM); Metrics.addRegistry(prometheusMeterRegistry); }
public static Counter getIllegalArgumentException() { return Metrics.counter("nacos_exception", "module", "config", "name", "illegalArgument"); }
void configure(MeterRegistry registry) { // Customizers must be applied before binders, as they may add custom // tags or alter timer or summary configuration. customize(registry); addFilters(registry); addBinders(registry); if (this.addToGlobalRegistry && registry != Metrics.globalRegistry) { Metrics.addRegistry(registry); } }
public static Timer getNamingRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "naming", "method", method, "url", url, "code", code); } }
public static Counter getNacosException() { return Metrics.counter("nacos_exception", "module", "config", "name", "nacos"); }
void configure(MeterRegistry registry) { // Customizers must be applied before binders, as they may add custom // tags or alter timer or summary configuration. customize(registry); addFilters(registry); addBinders(registry); if (this.addToGlobalRegistry && registry != Metrics.globalRegistry) { Metrics.addRegistry(registry); } }
public static Timer getNotifyRtTimer() { return Metrics.timer("nacos_timer", "module", "config", "name", "notifyRt"); }
public static Counter getConfigNotifyException() { return Metrics.counter("nacos_exception", "module", "config", "name", "configNotify"); }
public static Timer getNamingRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "naming", "method", method, "url", url, "code", code); } }
public static Counter getDbException() { return Metrics.counter("nacos_exception", "module", "config", "name", "db"); }
public static Timer getConfigRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "config", "method", method, "url", url, "code", code); }
public static Counter getUnhealthException() { return Metrics.counter("nacos_exception", "module", "config", "name", "unhealth"); }
public static Timer getNotifyRtTimer() { return Metrics.timer("nacos_timer", "module", "config", "name", "notifyRt"); }
public static Counter getDiskException() { return Metrics.counter("nacos_exception", "module", "naming", "name", "disk"); }