Search in sources :

Example 1 with NoopMeter

use of com.couchbase.client.core.cnc.metrics.NoopMeter in project couchbase-jvm-clients by couchbase.

the class RequestContext method logicallyComplete.

/**
 * Signals that this request is completed fully, including streaming sections or logical sub-requests also being
 * completed (i.e. observe polling).
 */
@Stability.Internal
public RequestContext logicallyComplete() {
    this.logicallyCompletedAt = System.nanoTime();
    RequestSpan span = request.requestSpan();
    if (span != null) {
        span.attribute(TracingIdentifiers.ATTR_RETRIES, retryAttempts());
        span.end();
    }
    if (!(environment().meter() instanceof NoopMeter)) {
        long latency = logicalRequestLatency();
        if (latency > 0) {
            core().responseMetric(request).recordValue(latency);
        }
    }
    return this;
}
Also used : NoopMeter(com.couchbase.client.core.cnc.metrics.NoopMeter) RequestSpan(com.couchbase.client.core.cnc.RequestSpan)

Aggregations

RequestSpan (com.couchbase.client.core.cnc.RequestSpan)1 NoopMeter (com.couchbase.client.core.cnc.metrics.NoopMeter)1