Package com.datastax.driver.core
Class PerHostPercentileTracker
- java.lang.Object
-
- com.datastax.driver.core.PercentileTracker
-
- com.datastax.driver.core.PerHostPercentileTracker
-
- All Implemented Interfaces:
LatencyTracker
public class PerHostPercentileTracker extends PercentileTracker
APercentileTrackerthat maintains a separate histogram for each host.This gives you per-host latency percentiles, meaning that each host will only be compared to itself.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPerHostPercentileTracker.BuilderHelper class to buildPerHostPercentileTrackerinstances with a fluent interface.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PerHostPercentileTracker.Builderbuilder(long highestTrackableLatencyMillis)Returns a builder to create a new instance.protected HostcomputeKey(Host host, Statement statement, Exception exception)Computes a key used to categorize measurements.-
Methods inherited from class com.datastax.driver.core.PercentileTracker
getLatencyAtPercentile, include, onRegister, onUnregister, update
-
-
-
-
Method Detail
-
computeKey
protected Host 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 PerHostPercentileTracker.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.
-
-