use of io.crate.planner.operators.StatementClassifier.Classification in project crate by crate.
the class QueryStatsTest method testTrackedStatementTypes.
@Test
public void testTrackedStatementTypes() {
List<MetricsView> oneMetricForEachStatementType = new ArrayList<>();
for (StatementType type : StatementType.values()) {
if (type.equals(StatementType.UNDEFINED)) {
continue;
}
oneMetricForEachStatementType.add(createMetric(new Classification(type), 1));
}
Map<StatementType, QueryStats.Metric> metricsByCommand = createMetricsMap(oneMetricForEachStatementType);
assertThat(metricsByCommand.size(), is(7));
assertThat(metricsByCommand.get(StatementType.SELECT), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.UPDATE), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.INSERT), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.DELETE), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.DDL), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.MANAGEMENT), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.COPY), is(notNullValue()));
assertThat(metricsByCommand.get(StatementType.UNDEFINED), is(nullValue()));
}
Aggregations