Class ActionTimer

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

public class ActionTimer extends Object
Tracks the results and of an action that can succeed or fail, along with elapsed time.

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 ActionTimer.Builder builder(io.micrometer.core.instrument.MeterRegistry registry, String name)
    • track

      public void track(com.couchbase.client.core.deps.io.netty.util.concurrent.Future<?> f)
    • success

      public void success(long elapsed, TimeUnit unit)
      Increments the "success" count.
    • failure

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

      public void failure(long elapsed, TimeUnit unit, String exception)