use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.
the class SqlLargeDataTest method testQueryLargeData.
@Issue("3890")
@Test
public void testQueryLargeData() throws Exception {
ArrayList<SeriesCommand> seriesRequests = new ArrayList<>(ENTITIES_COUNT);
Registry.Entity.checkExists(ENTITY_NAME);
Registry.Metric.checkExists(METRIC_NAME);
for (int i = 1; i <= ENTITIES_COUNT; i++) {
// manually set entity and metric to avoid check
Series series = new Series();
series.setEntity(ENTITY_NAME);
series.setMetric(METRIC_NAME);
series.addTag("tag", String.valueOf(i));
series.addSamples(createTestSample(i));
seriesRequests.addAll(series.toCommands());
}
TCPSender.sendChecked(new LargeDataCheck(ENTITY_NAME, METRIC_NAME, ENTITIES_COUNT), seriesRequests);
String sqlQuery = String.format("SELECT COUNT(*) " + "FROM \"%s\" " + "GROUP BY entity", METRIC_NAME);
String[][] expectedRows = { { String.valueOf(ENTITIES_COUNT) } };
assertSqlQueryRows("Large data query error", expectedRows, sqlQuery);
}
use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.
the class DQuoteCharEscapeTest method testMetric.
@Issue("2854")
@Test
public void testMetric() throws Exception {
Series series = new Series("series-command-test-e2", "series-command-test\"-m2");
Sample sample = Sample.ofDateInteger(Mocks.ISO_TIME, 1);
series.addSamples(sample);
SeriesCommand seriesCommand = new SeriesCommand();
seriesCommand.setTimeISO(sample.getRawDate());
seriesCommand.setEntityName(series.getEntity());
seriesCommand.setValues(Collections.singletonMap(series.getMetric(), sample.getValue().toString()));
CommandMethod.send(seriesCommand);
assertSeriesExisting(series);
}
use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.
the class EqualCharEscapeTest method testEntity.
@Issue("2854")
@Test
public void testEntity() throws Exception {
Series series = new Series("series-command-test=-e3", "series-command-test-m3");
Sample sample = Sample.ofJavaDateInteger(TestUtil.getCurrentDate(), 1);
series.addSamples(sample);
SeriesCommand seriesCommand = new SeriesCommand();
seriesCommand.setTimeISO(sample.getRawDate());
seriesCommand.setEntityName(series.getEntity());
seriesCommand.setValues(Collections.singletonMap(series.getMetric(), sample.getValue().toString()));
CommandMethod.send(seriesCommand);
assertSeriesExisting(series);
}
Aggregations