use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SqlIsNullOperatorTest method prepareData.
@BeforeClass
public static void prepareData() throws Exception {
List<Series> seriesList = new ArrayList<>();
seriesList.add(new Series(TEST_ENTITY1_NAME, TEST_METRIC_NAME, "tag1", "val1") {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:00:00.000Z", 1));
}
});
seriesList.add(new Series(TEST_ENTITY2_NAME, TEST_METRIC_NAME, "tag1", "val2", "tag2", "val2") {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:05:00.000Z", 2));
}
});
seriesList.add(new Series(TEST_ENTITY3_NAME, TEST_METRIC_NAME, "tag2", "val3") {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:10:00.000Z", 3));
}
});
seriesList.add(new Series(TEST_ENTITY4_NAME, TEST_METRIC_NAME, "tag4", "val4") {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:15:00.000Z", 4));
}
});
seriesList.add(new Series(TEST_ENTITY5_NAME, TEST_METRIC_NAME) {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:20:00.000Z", 5));
}
});
EntityMethod.createOrReplaceEntityCheck(new Entity(TEST_ENTITY1_NAME, new HashMap<String, String>() {
{
put("tag1", "val1");
}
}));
SeriesMethod.insertSeriesCheck(seriesList);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SqlLookupFunctionTest method prepareData.
@BeforeClass
public static void prepareData() throws Exception {
String testEntityNameTagsCase = entity();
List<Series> seriesList = new ArrayList<>();
{
Series series = new Series(entity(), TEST_METRIC_NAME_BASE_LOOKUP_CASE);
series.addSamples(Sample.ofDateText("2016-06-03T09:20:00.000Z", "word"), Sample.ofDateText("2016-06-03T09:21:00.000Z", "-1"), Sample.ofDateText("2016-06-03T09:22:00.000Z", "1"), Sample.ofDateText("2016-06-03T09:23:00.000Z", "2"), Sample.ofDateText("2016-06-03T09:24:00.000Z", "word"), Sample.ofDateText("2016-06-03T09:25:00.000Z", "words"), Sample.ofDateText("2016-06-03T09:26:00.000Z", "3"), Sample.ofDateText("2016-06-03T09:27:00.000Z", "4"), Sample.ofDateText("2016-06-03T09:28:00.000Z", "PI"), Sample.ofDateText("2016-06-03T09:29:00.000Z", "3.14"), Sample.ofDateText("2016-06-03T09:30:00.000Z", "nothing"));
seriesList.add(series);
}
Map<String, String> tags = new HashMap<>();
tags.put("1", "-1");
tags.put("2", "1");
tags.put("3", "2");
tags.put("4", "word");
tags.put("5", "words");
tags.put("6", "3");
tags.put("7", "4");
tags.put("8", "PI");
tags.put("9", "3.14");
tags.put("10", "nothing");
Metric metric = new Metric(TEST_METRIC_NAME_TAGS_CASE, tags);
Entity entity = new Entity(testEntityNameTagsCase, tags);
Series series = new Series(testEntityNameTagsCase, TEST_METRIC_NAME_TAGS_CASE, tags);
series.addSamples(Sample.ofDateInteger("2016-06-03T09:20:00.000Z", 1));
seriesList.add(series);
MetricMethod.createOrReplaceMetricCheck(metric);
EntityMethod.createOrReplaceEntityCheck(entity);
SeriesMethod.insertSeriesCheck(seriesList);
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SqlTagNameWithDoubleQuotationTest method prepareData.
@BeforeClass
public static void prepareData() throws Exception {
final Map<String, String> tags = Collections.unmodifiableMap(new HashMap<String, String>() {
{
put("tag", "0");
put("tag\"quotation", "1");
put("tag+plus", "2");
put("tag-minus", "3");
put("tag*multiple", "4");
put("tag/division", "5");
put("tag\"quotation'", "6");
}
});
Series series = new Series(TEST_ENTITY_NAME, TEST_METRIC_NAME, tags) {
{
addSamples(Sample.ofDateInteger("2016-06-19T11:00:00.500Z", 0));
}
};
MetricMethod.createOrReplaceMetricCheck(new Metric(TEST_METRIC_NAME, tags));
EntityMethod.createOrReplaceEntityCheck(new Entity(TEST_ENTITY_NAME, tags));
SeriesMethod.insertSeriesCheck(Collections.singletonList(series));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class TCPSenderTest method testDebugSend.
@Test
public void testDebugSend() throws Exception {
Entity entity = new Entity(entity(), TAGS);
entity.setTimeZoneID(TIMEZONE_ID);
entity.setInterpolationMode(InterpolationMode.LINEAR);
entity.setLabel(LABEL);
String result = TCPSender.send(singletonList(new EntityCommand(entity)), true);
assertEquals("ok", result);
assertCheck(new EntityCheck(entity));
}
use of com.axibase.tsd.api.model.entity.Entity in project atsd-api-test by axibase.
the class SqlSyntaxQuotesEscapingTest method prepareData.
@BeforeClass
public void prepareData() throws Exception {
Map<String, String> tags = new HashMap<>();
tags.put("double\"quote", "tv1");
tags.put("single'quote", "tv2");
tags.put("both'quo\"tes", "tv3");
Series series = new Series(TEST_ENTITY_NAME, TEST_METRIC_NAME, tags);
series.addSamples(Sample.ofDateDecimal("2016-07-27T22:41:50.407Z", new BigDecimal("12.4")));
SeriesMethod.insertSeriesCheck(Collections.singletonList(series));
Metric updatedMetricQuery = new Metric();
updatedMetricQuery.setTags(tags);
MetricMethod.updateMetric(TEST_METRIC_NAME, updatedMetricQuery);
Entity updatedEntityQuery = new Entity();
updatedEntityQuery.setTags(tags);
MetricMethod.updateMetric(TEST_METRIC_NAME, updatedEntityQuery);
}
Aggregations