use of org.apache.cassandra.metrics.ClientRequestMetrics in project cassandra by apache.
the class QueryProcessor method processNodeLocalSelect.
private ResultMessage processNodeLocalSelect(SelectStatement statement, QueryState queryState, QueryOptions options) {
ClientRequestMetrics levelMetrics = ClientRequestsMetricsHolder.readMetricsForLevel(ConsistencyLevel.NODE_LOCAL);
ClientRequestMetrics globalMetrics = ClientRequestsMetricsHolder.readMetrics;
if (StorageService.instance.isBootstrapMode() && !SchemaConstants.isLocalSystemKeyspace(statement.keyspace())) {
levelMetrics.unavailables.mark();
globalMetrics.unavailables.mark();
throw new IsBootstrappingException();
}
long startTime = nanoTime();
try {
return statement.executeLocally(queryState, options);
} finally {
long latency = nanoTime() - startTime;
levelMetrics.addNano(latency);
globalMetrics.addNano(latency);
}
}
use of org.apache.cassandra.metrics.ClientRequestMetrics in project cassandra by apache.
the class QueryProcessor method processNodeLocalWrite.
private ResultMessage processNodeLocalWrite(CQLStatement statement, QueryState queryState, QueryOptions options) {
ClientRequestMetrics levelMetrics = ClientRequestsMetricsHolder.writeMetricsForLevel(ConsistencyLevel.NODE_LOCAL);
ClientRequestMetrics globalMetrics = ClientRequestsMetricsHolder.writeMetrics;
long startTime = nanoTime();
try {
return statement.executeLocally(queryState, options);
} finally {
long latency = nanoTime() - startTime;
levelMetrics.addNano(latency);
globalMetrics.addNano(latency);
}
}
Aggregations