public static Counter getLeaderSendBeatFailedException() { return Metrics.counter("nacos_exception", "module", "naming", "name", "leaderSendBeatFailed"); } }
public static Timer getNamingRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "naming", "method", method, "url", url, "code", code); } }
void onRequestRejected() { rejectedRequests.increment(); } }
@Override public void onNext(T t) { if (done) { this.malformedSourceCounter.increment(); Operators.onNextDropped(t, actual.currentContext()); return; } //record the delay since previous onNext/onSubscribe. This also records the count. long last = this.lastNextEventNanos; this.lastNextEventNanos = clock.monotonicTime(); this.onNextIntervalTimer.record(lastNextEventNanos - last, TimeUnit.NANOSECONDS); actual.onNext(t); }
@Override public void onSubscribe(Subscription s) { if (Operators.validate(this.s, s)) { this.subscribedCounter.increment(); this.subscribeToTerminateSample = Timer.start(clock); this.lastNextEventNanos = clock.monotonicTime(); if (s instanceof Fuseable.QueueSubscription) { //noinspection unchecked this.qs = (Fuseable.QueueSubscription<T>) s; } this.s = s; actual.onSubscribe(this); } }
@Override public void recordConnectionCreatedMillis(long connectionCreatedMillis) { connectionCreation.record(connectionCreatedMillis, TimeUnit.MILLISECONDS); } }
/** * Constructs a new Micrometer metrics listener that adds metrics to the given registry with the given list of tags. * * @param meterRegistry the registry to which to add metrics * @param tagKeysAndValues an optional list of tag keys/values to attach to metrics; must be an even number of * strings representing alternating key/value pairs */ public MicrometerApnsClientMetricsListener(final MeterRegistry meterRegistry, final String... tagKeysAndValues) { this(meterRegistry, Tags.of(tagKeysAndValues)); }
@Override public void onComplete() { if (done) { this.malformedSourceCounter.increment(); return; } done = true; //we don't record the time between last onNext and onComplete, // because it would skew the onNext count by one this.subscribeToTerminateSample.stop(subscribeToCompleteTimer); actual.onComplete(); }
/** * Records that a previously-started attempt to connect to the APNs server failed and updates metrics accordingly. * * @param apnsClient the client that failed to connect; note that this is ignored by * {@code MicrometerApnsClientMetricsListener} instances, which should always be used for exactly one client */ @Override public void handleConnectionCreationFailed(final ApnsClient apnsClient) { this.connectionFailures.increment(); } }
public static Counter getNacosException() { return Metrics.counter("nacos_exception", "module", "config", "name", "nacos"); }
public static Timer getConfigRequestMonitor(String method, String url, String code) { return Metrics.timer("nacos_client_request", "module", "config", "method", method, "url", url, "code", code); }
@Override public void recordConnectionTimeout() { connectionTimeoutCounter.increment(); }
public static Counter getConfigNotifyException() { return Metrics.counter("nacos_exception", "module", "config", "name", "configNotify"); }
public static Timer getNotifyRtTimer() { return Metrics.timer("nacos_timer", "module", "config", "name", "notifyRt"); }
public static Counter getIllegalArgumentException() { return Metrics.counter("nacos_exception", "module", "config", "name", "illegalArgument"); }
public static Counter getDbException() { return Metrics.counter("nacos_exception", "module", "config", "name", "db"); }
public static Counter getUnhealthException() { return Metrics.counter("nacos_exception", "module", "config", "name", "unhealth"); }
public static Counter getDiskException() { return Metrics.counter("nacos_exception", "module", "naming", "name", "disk"); }