use of com.datastax.oss.driver.internal.core.session.throttling.ConcurrencyLimitingRequestThrottler in project java-driver by datastax.
the class AbstractMetricUpdater method throttlingQueueSize.
protected int throttlingQueueSize() {
RequestThrottler requestThrottler = context.getRequestThrottler();
if (requestThrottler instanceof ConcurrencyLimitingRequestThrottler) {
return ((ConcurrencyLimitingRequestThrottler) requestThrottler).getQueueSize();
}
if (requestThrottler instanceof RateLimitingRequestThrottler) {
return ((RateLimitingRequestThrottler) requestThrottler).getQueueSize();
}
LOG.warn("[{}] Metric {} does not support {}, it will always return 0", context.getSessionName(), DefaultSessionMetric.THROTTLING_QUEUE_SIZE.getPath(), requestThrottler.getClass().getName());
return 0;
}
Aggregations