public static class QueryLogger.ConstantThresholdQueryLogger extends QueryLogger
QueryLogger.DynamicThresholdQueryLogger
which is still in beta state.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 |
---|---|
long |
getSlowQueryLatencyThresholdMillis()
Return the threshold in milliseconds 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) |
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 |
onUnregister(Cluster cluster)
Gets invoked when the tracker is unregistered from a cluster, or at cluster shutdown if
the tracker was not unregistered.
|
void |
setSlowQueryLatencyThresholdMillis(long slowQueryLatencyThresholdMillis)
Set the threshold in milliseconds 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, parameterValueAsString, parameterValueAsString, setMaxLoggedParameters, setMaxParameterValueLength, setMaxQueryStringLength, statementAsString, update
public long getSlowQueryLatencyThresholdMillis()
QueryLogger.DEFAULT_SLOW_QUERY_THRESHOLD_MS
.public void setSlowQueryLatencyThresholdMillis(long slowQueryLatencyThresholdMillis)
slowQueryLatencyThresholdMillis
- Slow queries threshold in milliseconds.
It must be strictly positive.IllegalArgumentException
- if slowQueryLatencyThresholdMillis <= 0
.protected void maybeLogNormalOrSlowQuery(Host host, Statement statement, long latencyMs)
maybeLogNormalOrSlowQuery
in class QueryLogger
public void onRegister(Cluster cluster)
LifecycleAwareLatencyTracker
Cluster.register(LatencyTracker)
.cluster
- the cluster that this tracker is registered with.public void onUnregister(Cluster cluster)
LifecycleAwareLatencyTracker
cluster
- the cluster that this tracker was registered with.