Search in sources :

Example 1 with SeriesCommand

use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.

the class DoubleBackslashCharEscapeTest method testMetric.

@Issue("2854")
@Test
public void testMetric() throws Exception {
    Series series = new Series("series-command-test-e8", "series-command-test\\\\-m8");
    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);
}
Also used : Series(com.axibase.tsd.api.model.series.Series) Sample(com.axibase.tsd.api.model.series.Sample) SeriesCommand(com.axibase.tsd.api.model.command.SeriesCommand) Issue(io.qameta.allure.Issue) SeriesTest(com.axibase.tsd.api.method.series.SeriesTest) Test(org.testng.annotations.Test)

Example 2 with SeriesCommand

use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.

the class CompressedPayloadTest method getGzipCompressedCommand.

@BeforeClass
public static void getGzipCompressedCommand() {
    SeriesCommand command = new SeriesCommand();
    command.setTimeISO(Mocks.ISO_TIME);
    command.setEntityName(entityName);
    command.setValues(singletonMap(metricName, "1"));
    gzipOutput = getGzipBytes(command.toString());
}
Also used : SeriesCommand(com.axibase.tsd.api.model.command.SeriesCommand) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with SeriesCommand

use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.

the class AppendFieldTest method testDecimalFieldToTextField.

@Issue("3874")
@Test
public void testDecimalFieldToTextField() throws Exception {
    final String entityName = entity();
    final String metricDecimalToText = metric();
    Series series = new Series(entityName, metricDecimalToText);
    series.addSamples(Sample.ofDateDecimalText(ISO_TIME, DECIMAL_VALUE, TEXT_VALUE));
    List<PlainCommand> seriesCommandList = Arrays.asList(new SeriesCommand(singletonMap(metricDecimalToText, TEXT_VALUE), null, entityName, null, null, null, ISO_TIME, true), new SeriesCommand(null, singletonMap(metricDecimalToText, DECIMAL_VALUE.toString()), entityName, null, null, null, ISO_TIME, false));
    CommandMethod.send(seriesCommandList);
    assertTextDataEquals(series, "Addition decimal field to text field failed");
}
Also used : Series(com.axibase.tsd.api.model.series.Series) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) SeriesCommand(com.axibase.tsd.api.model.command.SeriesCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) CommandMethodTest(com.axibase.tsd.api.extended.CommandMethodTest)

Example 4 with SeriesCommand

use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.

the class AppendFieldTest method testTextFieldAfterAdditionOfDecimalValue.

@Issue("3902")
@Test
public void testTextFieldAfterAdditionOfDecimalValue() throws Exception {
    final String entityName = entity();
    final String metricTextAfterDecimalAddition = metric();
    Series series = new Series(entityName, metricTextAfterDecimalAddition);
    series.addSamples(Sample.ofDateText(ISO_TIME, TEXT_VALUE));
    List<PlainCommand> seriesCommandList = Arrays.asList(new SeriesCommand(singletonMap(metricTextAfterDecimalAddition, TEXT_VALUE), null, entityName, null, null, null, ISO_TIME, true), new SeriesCommand(null, singletonMap(metricTextAfterDecimalAddition, DECIMAL_VALUE.toString()), entityName, null, null, null, ISO_TIME, null));
    CommandMethod.send(seriesCommandList);
    assertTextDataEquals(series, "Addition of decimal value corrupted text field");
}
Also used : Series(com.axibase.tsd.api.model.series.Series) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) SeriesCommand(com.axibase.tsd.api.model.command.SeriesCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) CommandMethodTest(com.axibase.tsd.api.extended.CommandMethodTest)

Example 5 with SeriesCommand

use of com.axibase.tsd.api.model.command.SeriesCommand in project atsd-api-test by axibase.

the class AppendFieldTest method testAppendTextViaBatchOfCommands.

@Issue("3885")
@Test
public void testAppendTextViaBatchOfCommands() throws Exception {
    final String entityName = entity();
    final String metricAppendTextViaBatch = metric();
    Series series = new Series(entityName, metricAppendTextViaBatch);
    series.addSamples(Sample.ofDateText(ISO_TIME, "text1;\ntext2"));
    List<PlainCommand> seriesCommandList = new ArrayList<>(Arrays.asList(new SeriesCommand(singletonMap(metricAppendTextViaBatch, "text1"), null, entityName, null, null, null, ISO_TIME, false), new SeriesCommand(singletonMap(metricAppendTextViaBatch, "text2"), null, entityName, null, null, null, ISO_TIME, true), new SeriesCommand(null, singletonMap(metricAppendTextViaBatch, DECIMAL_VALUE.toString()), entityName, null, null, null, ISO_TIME, null)));
    CommandMethod.send(seriesCommandList);
    assertTextDataEquals(series, "Addition text field to text field failed");
}
Also used : Series(com.axibase.tsd.api.model.series.Series) PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) ArrayList(java.util.ArrayList) SeriesCommand(com.axibase.tsd.api.model.command.SeriesCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) CommandMethodTest(com.axibase.tsd.api.extended.CommandMethodTest)

Aggregations

SeriesCommand (com.axibase.tsd.api.model.command.SeriesCommand)18 Series (com.axibase.tsd.api.model.series.Series)16 Issue (io.qameta.allure.Issue)16 Test (org.testng.annotations.Test)16 Sample (com.axibase.tsd.api.model.series.Sample)8 SeriesTest (com.axibase.tsd.api.method.series.SeriesTest)6 CommandMethodTest (com.axibase.tsd.api.extended.CommandMethodTest)5 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)5 ArrayList (java.util.ArrayList)4 BigDecimal (java.math.BigDecimal)2 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)1 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1 BeforeClass (org.testng.annotations.BeforeClass)1