public static class QueryLogger.DynamicThresholdQueryLogger extends QueryLogger
PercentileTracker
.QueryLogger.Builder, QueryLogger.ConstantThresholdQueryLogger, QueryLogger.DynamicThresholdQueryLogger
cluster, DEFAULT_MAX_LOGGED_PARAMETERS, DEFAULT_MAX_PARAMETER_VALUE_LENGTH, DEFAULT_MAX_QUERY_STRING_LENGTH, DEFAULT_SLOW_QUERY_THRESHOLD_MS, DEFAULT_SLOW_QUERY_THRESHOLD_PERCENTILE, ERROR_LOGGER, maxLoggedParameters, maxParameterValueLength, maxQueryStringLength, NORMAL_LOGGER, SLOW_LOGGER
Modifier and Type | Method and Description |
---|---|
PercentileTracker |
getPercentileLatencyTracker()
Return the percentile tracker to use for recording per-host latency histograms.
|
double |
getSlowQueryLatencyThresholdPercentile()
Return the threshold percentile beyond which queries are considered 'slow'
and logged as such by the driver.
|
protected void |
maybeLogNormalOrSlowQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
maybeLogSlowQuery(Host host,
Statement statement,
long latencyMs,
long threshold) |
void |
onRegister(Cluster cluster)
Gets invoked when the tracker is registered with a cluster, or at cluster startup if the
tracker was registered at initialization with
Cluster.register(LatencyTracker) . |
void |
setPercentileLatencyTracker(PercentileTracker percentileLatencyTracker)
Set the percentile tracker to use for recording per-host latency histograms.
|
void |
setSlowQueryLatencyThresholdPercentile(double slowQueryLatencyThresholdPercentile)
Set the threshold percentile beyond which queries are considered 'slow'
and logged as such by the driver.
|
append, append, appendParameters, appendParameters, builder, countBoundValues, getMaxLoggedParameters, getMaxParameterValueLength, getMaxQueryStringLength, logQuery, maybeLogErrorQuery, maybeLogNormalQuery, onUnregister, parameterValueAsString, parameterValueAsString, setMaxLoggedParameters, setMaxParameterValueLength, setMaxQueryStringLength, statementAsString, update
public PercentileTracker getPercentileLatencyTracker()
null
.public void setPercentileLatencyTracker(PercentileTracker percentileLatencyTracker)
null
.percentileLatencyTracker
- the percentile tracker instance to use.IllegalArgumentException
- if percentileLatencyTracker == null
.public double getSlowQueryLatencyThresholdPercentile()
QueryLogger.DEFAULT_SLOW_QUERY_THRESHOLD_PERCENTILE
.public void setSlowQueryLatencyThresholdPercentile(double slowQueryLatencyThresholdPercentile)
slowQueryLatencyThresholdPercentile
- Slow queries threshold percentile.
It must be comprised between 0 inclusive and 100 exclusive.IllegalArgumentException
- if slowQueryLatencyThresholdPercentile < 0 || slowQueryLatencyThresholdPercentile >= 100
.protected void maybeLogNormalOrSlowQuery(Host host, Statement statement, long latencyMs)
maybeLogNormalOrSlowQuery
in class QueryLogger
protected void maybeLogSlowQuery(Host host, Statement statement, long latencyMs, long threshold)
public void onRegister(Cluster cluster)
LatencyTracker
Cluster.register(LatencyTracker)
.onRegister
in interface LatencyTracker
onRegister
in class QueryLogger
cluster
- the cluster that this tracker is registered with.