Class ClusterWidePercentileTracker

  • All Implemented Interfaces:
    LatencyTracker

    public class ClusterWidePercentileTracker
    extends PercentileTracker
    A PercentileTracker that aggregates all measurements into a single histogram.

    This gives you global latency percentiles for the whole cluster, meaning that latencies of slower hosts will tend to appear in higher percentiles.

    • Method Detail

      • computeKey

        protected Cluster computeKey​(Host host,
                                     Statement statement,
                                     Exception exception)
        Description copied from class: PercentileTracker
        Computes a key used to categorize measurements. Measurements with the same key will be recorded in the same histogram.

        It's recommended to keep the number of distinct keys low, in order to limit the memory footprint of the histograms.

        Specified by:
        computeKey in class PercentileTracker
        Parameters:
        host - the host that was queried.
        statement - the statement that was executed.
        exception - if the query failed, the corresponding exception.
        Returns:
        the key.
      • builder

        public static ClusterWidePercentileTracker.Builder builder​(long highestTrackableLatencyMillis)
        Returns a builder to create a new instance.
        Parameters:
        highestTrackableLatencyMillis - the highest expected latency. If a higher value is reported, it will be ignored and a warning will be logged. A good rule of thumb is to set it slightly higher than SocketOptions.getReadTimeoutMillis().
        Returns:
        the builder.