Class ActionCounter

java.lang.Object
com.couchbase.client.dcp.metrics.ActionCounter

public class ActionCounter extends Object
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.

  • 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

      public <V, F extends com.couchbase.client.core.deps.io.netty.util.concurrent.Future<V>> F track(F future, Function<V,String> errorExtractor)
    • success

      public void success()
      Increments the "success" count.
    • failure

      public void failure(Throwable reason)
      Increments the "failure" count.
      Parameters:
      reason - (nullable) cause of the failure, or null if unknown
    • failure

      public void failure(String exception)
    • run

      public void run(Runnable task)
    • call

      public <T> T call(Callable<T> task) throws Exception
      Throws:
      Exception
    • wrap

      public Runnable wrap(Runnable r)
    • wrap

      public <T> Callable<T> wrap(Callable<T> c)