Package com.couchbase.client.dcp.metrics
Class ActionCounter
java.lang.Object
com.couchbase.client.dcp.metrics.ActionCounter
Tracks the results of an action that can succeed or fail.
Instances are created via builder(io.micrometer.core.instrument.MeterRegistry, java.lang.String)
.
The tags match those used by CountedAspect
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionCounter.Builder
<T> T
void
void
Increments the "failure" count.void
void
success()
Increments the "success" count.<V,
F extends com.couchbase.client.core.deps.io.netty.util.concurrent.Future<V>>
Ftrack
(F future) <V,
F extends com.couchbase.client.core.deps.io.netty.util.concurrent.Future<V>>
F<T> Callable
<T>
-
Method Details
-
builder
public static ActionCounter.Builder builder(io.micrometer.core.instrument.MeterRegistry registry, String name) -
track
public <V,F extends com.couchbase.client.core.deps.io.netty.util.concurrent.Future<V>> F track(F future) -
track
-
success
public void success()Increments the "success" count. -
failure
Increments the "failure" count.- Parameters:
reason
- (nullable) cause of the failure, or null if unknown
-
failure
-
run
-
call
- Throws:
Exception
-
wrap
-
wrap
-