Search in sources :

Example 16 with Metric

use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.

the class MetricCommandTest method testTimezone.

@Issue("3137")
@Test
public void testTimezone() throws Exception {
    Metric metric = new Metric(metric());
    metric.setFilter("GMT0");
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with filter expression: %s", metric.getTimeZoneID());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 17 with Metric

use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.

the class MetricCommandTest method testLabel.

@Issue("3137")
@Test
public void testLabel() throws Exception {
    Metric metric = new Metric(metric());
    metric.setLabel(Mocks.LABEL);
    MetricCommand command = new MetricCommand(metric);
    CommandMethod.send(command);
    String assertMessage = String.format("Failed to insert metric with label: %s", metric.getLabel());
    assertMetricExisting(assertMessage, metric);
}
Also used : MetricCommand(com.axibase.tsd.api.model.command.MetricCommand) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 18 with Metric

use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.

the class MetricDeleteTest method testMetricNameContainsSlash.

@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
    final Metric metric = new Metric("delete/metric-2");
    createOrReplaceMetricCheck(metric);
    Response response = deleteMetric(metric.getName());
    assertEquals("Fail to execute deleteMetric query", OK.getStatusCode(), response.getStatus());
    assertFalse("Metric should be deleted", metricExist(metric));
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 19 with Metric

use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.

the class MetricDeleteTest method testMetricNameContainsCyrillic.

@Issue("1278")
@Test
public void testMetricNameContainsCyrillic() throws Exception {
    final Metric metric = new Metric("deleteйёmetric-3");
    createOrReplaceMetricCheck(metric);
    assertEquals("Fail to execute deleteMetric query", OK.getStatusCode(), deleteMetric(metric.getName()).getStatus());
    assertFalse("Metric should be deleted", metricExist(metric));
}
Also used : Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 20 with Metric

use of com.axibase.tsd.api.model.metric.Metric in project atsd-api-test by axibase.

the class MetricSeriesTest method testMetricNameContainsSlash.

@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
    final Metric metric = new Metric("series/metric-2");
    createOrReplaceMetricCheck(metric);
    assertTrue("series array should be empty", compareJsonString("[]", queryMetricSeries(metric.getName()).readEntity(String.class)));
}
Also used : Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

Metric (com.axibase.tsd.api.model.metric.Metric)76 Test (org.testng.annotations.Test)58 Issue (io.qameta.allure.Issue)50 Series (com.axibase.tsd.api.model.series.Series)25 Entity (com.axibase.tsd.api.model.entity.Entity)21 Response (javax.ws.rs.core.Response)16 BeforeClass (org.testng.annotations.BeforeClass)15 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)13 MetricCommand (com.axibase.tsd.api.model.command.MetricCommand)10 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)7 BigDecimal (java.math.BigDecimal)7 MetricCheck (com.axibase.tsd.api.method.checks.MetricCheck)5 HashMap (java.util.HashMap)5 File (java.io.File)4 ArrayList (java.util.ArrayList)4 SeriesSearchResultRecord (com.axibase.tsd.api.model.series.search.SeriesSearchResultRecord)3 Period (com.axibase.tsd.api.model.Period)2 Sample (com.axibase.tsd.api.model.series.Sample)2 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)2 SeriesSearchQuery (com.axibase.tsd.api.model.series.search.SeriesSearchQuery)2