use of com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO in project pinot by linkedin.
the class AbstractManagerTestBase method getTestIngraphMetricConfig.
protected IngraphMetricConfigDTO getTestIngraphMetricConfig(String rrd, String metric, String dashboard) {
IngraphMetricConfigDTO ingraphMetricConfigDTO = new IngraphMetricConfigDTO();
ingraphMetricConfigDTO.setRrdName(rrd);
ingraphMetricConfigDTO.setMetricName(metric);
ingraphMetricConfigDTO.setDashboardName(dashboard);
ingraphMetricConfigDTO.setContainer("test");
ingraphMetricConfigDTO.setMetricDataType("test");
ingraphMetricConfigDTO.setMetricSourceType("test");
return ingraphMetricConfigDTO;
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO in project pinot by linkedin.
the class TestIngraphMetricConfigManager method testUpdateIngraphMetric.
@Test(dependsOnMethods = { "testFindIngraphMetric" })
public void testUpdateIngraphMetric() {
IngraphMetricConfigDTO ingraphMetricConfigDTO = ingraphMetricConfigDAO.findById(ingraphMetricConfigId1);
Assert.assertNotNull(ingraphMetricConfigDTO);
Assert.assertEquals(ingraphMetricConfigDTO.getDashboardName(), dashboard1);
ingraphMetricConfigDTO.setDashboardName(dashboard2);
ingraphMetricConfigDAO.update(ingraphMetricConfigDTO);
ingraphMetricConfigDTO = ingraphMetricConfigDAO.findById(ingraphMetricConfigId1);
Assert.assertNotNull(ingraphMetricConfigDTO);
Assert.assertEquals(ingraphMetricConfigDTO.getDashboardName(), dashboard2);
List<IngraphMetricConfigDTO> ingraphMetricConfigDTOs = ingraphMetricConfigDAO.findByDashboard(dashboard2);
Assert.assertEquals(ingraphMetricConfigDTOs.size(), 2);
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO in project pinot by linkedin.
the class TestIngraphMetricConfigManager method testFindIngraphMetric.
@Test(dependsOnMethods = { "testCreateIngraphMetric" })
public void testFindIngraphMetric() {
List<IngraphMetricConfigDTO> ingraphMetricConfigDTOs = ingraphMetricConfigDAO.findAll();
Assert.assertEquals(ingraphMetricConfigDTOs.size(), 2);
ingraphMetricConfigDTOs = ingraphMetricConfigDAO.findByDashboard(dashboard1);
Assert.assertEquals(ingraphMetricConfigDTOs.size(), 1);
IngraphMetricConfigDTO ingraphMetricConfigDTO = ingraphMetricConfigDAO.findByDashboardAndMetricName(dashboard1, metric1);
Assert.assertEquals(ingraphMetricConfigDTO.getDashboardName(), dashboard1);
Assert.assertEquals(ingraphMetricConfigDTO.getMetricName(), metric1);
Assert.assertEquals(ingraphMetricConfigDTO.getRrdName(), rrd1);
ingraphMetricConfigDTO = ingraphMetricConfigDAO.findByRrdName(rrd1);
Assert.assertEquals(ingraphMetricConfigDTO.getDashboardName(), dashboard1);
Assert.assertEquals(ingraphMetricConfigDTO.getMetricName(), metric1);
Assert.assertEquals(ingraphMetricConfigDTO.getRrdName(), rrd1);
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO in project pinot by linkedin.
the class TestIngraphMetricConfigManager method testDeleteIngraphMetric.
@Test(dependsOnMethods = { "testUpdateIngraphMetric" })
public void testDeleteIngraphMetric() {
ingraphMetricConfigDAO.deleteById(ingraphMetricConfigId1);
IngraphMetricConfigDTO ingraphMetricConfigDTO = ingraphMetricConfigDAO.findById(ingraphMetricConfigId1);
Assert.assertNull(ingraphMetricConfigDTO);
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO in project pinot by linkedin.
the class IngraphMetricConfigResource method createMetricConfig.
@GET
@Path("/create")
public String createMetricConfig(@QueryParam("rrdName") String rrdName, @QueryParam("metricName") String metricName, @QueryParam("dashboardName") String dashboardName, @QueryParam("metricDataType") String metricDataType, @QueryParam("metricSourceType") String metricSourceType, @QueryParam("container") String container) {
try {
IngraphMetricConfigDTO ingraphMetricConfigDTO = new IngraphMetricConfigDTO();
ingraphMetricConfigDTO.setRrdName(rrdName);
ingraphMetricConfigDTO.setMetricName(metricName);
ingraphMetricConfigDTO.setDashboardName(dashboardName);
ingraphMetricConfigDTO.setContainer(container);
ingraphMetricConfigDTO.setMetricDataType(metricDataType);
ingraphMetricConfigDTO.setMetricSourceType(metricSourceType);
Long id = ingraphMetricConfigDao.save(ingraphMetricConfigDTO);
ingraphMetricConfigDTO.setId(id);
return JsonResponseUtil.buildResponseJSON(ingraphMetricConfigDTO).toString();
} catch (Exception e) {
return JsonResponseUtil.buildErrorResponseJSON("Failed to create rrd:" + rrdName).toString();
}
}
Aggregations