Class ConnectTimings

java.lang.Object
com.couchbase.client.core.io.netty.kv.ConnectTimings

public class ConnectTimings
extends Object
This class gets populated with timings and success/failure of different steps in the channel bootstrap process and later allows to extract useful information for debugging.
Since:
2.0.0
  • Method Summary

    Modifier and Type Method Description
    static void record​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz)
    Convenience method to record a single timing right away.
    static void start​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz)
    Start the connect timings for a given class and channel.
    static Optional<Duration> stop​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz, boolean timeout)
    Stops the timing.
    static SortedMap<String,​Duration> toMap​(com.couchbase.client.core.deps.io.netty.channel.Channel channel)  
    static String toString​(com.couchbase.client.core.deps.io.netty.channel.Channel channel)
    Exports the timings into a string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • start

      public static void start​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz)
      Start the connect timings for a given class and channel.
      Parameters:
      channel - the channel to start from.
      clazz - the clazz to use as an identifier key.
    • stop

      public static Optional<Duration> stop​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz, boolean timeout)
      Stops the timing.
      Parameters:
      channel - the channel to start from.
      clazz - the clazz to use as an identifier key.
      timeout - if stopped because of a timeout or not.
      Returns:
      the duration.
    • record

      public static void record​(com.couchbase.client.core.deps.io.netty.channel.Channel channel, Class<?> clazz)
      Convenience method to record a single timing right away.
      Parameters:
      channel - the channel to start from.
      clazz - the clazz to use as an identifier key.
    • toString

      public static String toString​(com.couchbase.client.core.deps.io.netty.channel.Channel channel)
      Exports the timings into a string.
      Parameters:
      channel - which channel to export.
      Returns:
      the exported string.
    • toMap

      public static SortedMap<String,​Duration> toMap​(com.couchbase.client.core.deps.io.netty.channel.Channel channel)