Package com.datastax.driver.core
Class ClusterWidePercentileTracker
- java.lang.Object
-
- com.datastax.driver.core.PercentileTracker
-
- com.datastax.driver.core.ClusterWidePercentileTracker
-
- All Implemented Interfaces:
LatencyTracker
public class ClusterWidePercentileTracker extends PercentileTracker
APercentileTrackerthat 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusterWidePercentileTracker.BuilderHelper class to buildPerHostPercentileTrackerinstances with a fluent interface.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClusterWidePercentileTracker.Builderbuilder(long highestTrackableLatencyMillis)Returns a builder to create a new instance.protected ClustercomputeKey(Host host, Statement statement, Exception exception)Computes a key used to categorize measurements.voidonRegister(Cluster cluster)Gets invoked when the tracker is registered with a cluster, or at cluster startup if the tracker was registered at initialization withCluster.register(LatencyTracker).-
Methods inherited from class com.datastax.driver.core.PercentileTracker
getLatencyAtPercentile, include, onUnregister, update
-
-
-
-
Method Detail
-
onRegister
public void onRegister(Cluster cluster)
Description copied from interface:LatencyTrackerGets invoked when the tracker is registered with a cluster, or at cluster startup if the tracker was registered at initialization withCluster.register(LatencyTracker).- Specified by:
onRegisterin interfaceLatencyTracker- Overrides:
onRegisterin classPercentileTracker- Parameters:
cluster- the cluster that this tracker is registered with.
-
computeKey
protected Cluster computeKey(Host host, Statement statement, Exception exception)
Description copied from class:PercentileTrackerComputes 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:
computeKeyin classPercentileTracker- 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 thanSocketOptions.getReadTimeoutMillis().- Returns:
- the builder.
-
-