@Beta public static class QueryLogger.DynamicThresholdQueryLogger extends QueryLogger
Dynamic thresholds are based on per-host latency percentiles, as computed
by PerHostPercentileTracker
.
This class is currently provided as a beta preview: it hasn't been extensively tested yet, and the API is still subject to change.
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 |
---|---|
PerHostPercentileTracker |
getPerHostPercentileLatencyTracker()
Return the
PerHostPercentileTracker instance 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 |
setPerHostPercentileLatencyTracker(PerHostPercentileTracker perHostPercentileLatencyTracker)
Set the
PerHostPercentileTracker instance 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, builder, countBoundValues, getMaxLoggedParameters, getMaxParameterValueLength, getMaxQueryStringLength, logQuery, maybeLogErrorQuery, maybeLogNormalQuery, parameterValueAsString, setMaxLoggedParameters, setMaxParameterValueLength, setMaxQueryStringLength, statementAsString, update
public PerHostPercentileTracker getPerHostPercentileLatencyTracker()
PerHostPercentileTracker
instance to use for recording per-host latency histograms.
Cannot be null
.PerHostPercentileTracker
instance to use.public void setPerHostPercentileLatencyTracker(PerHostPercentileTracker perHostPercentileLatencyTracker)
PerHostPercentileTracker
instance to use for recording per-host latency histograms.
Cannot be null
.perHostPercentileLatencyTracker
- the PerHostPercentileTracker
instance to use.IllegalArgumentException
- if perHostPercentileLatencyTracker == 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
Copyright © 2012–2015. All rights reserved.