use of com.ning.metrics.meteo.binder.StatementsConfig in project meteo by pierre.
the class TestPublishersCompilerStreamConfig method setUp.
@BeforeTest
public void setUp() {
// Build the following configuration
// {
// "publishers": [
// {
// "name": "OpenTSDB",
// "type": "com.ning.metrics.meteo.publishers.OpenTSDBListener",
// "host": "opentsdb.company.com",
// "port": 4242
// }
// ],
//
// "streams": [
// {
// "name": "TPs of visit",
//
// "sql": [
// "select tp90 from visit output last every 1 second"
// ],
//
// "routes": [
// {
// "name": "OpenTSDB",
// "filters": [ "predict", "tp90" ],
// "timeAttribute": "visit_date"
// }
// ]
// }
// ]
// }
statementsConfig = new StatementsConfig();
final DummyPublisherConfig globalPublisherConfig = new DummyPublisherConfig();
globalPublisherConfig.setName("OpenTSDB");
globalPublisherConfig.setType("com.ning.metrics.meteo.publishers.OpenTSDBListener");
globalPublisherConfig.setHost("opentsdb.company.com");
globalPublisherConfig.setPort(4242);
statementsConfig.setPublishers(Arrays.asList((PublisherConfig) globalPublisherConfig));
final StreamConfig streamConfig = new StreamConfig();
streamConfig.setName("TPs of Visit");
streamConfig.setSql(Arrays.asList("select tp90 from visit output last every 1 second"));
final HashMap<String, Object> localPublisherConfig = new HashMap<String, Object>();
localPublisherConfig.put("name", "OpenTSDB");
localPublisherConfig.put("filters", (Arrays.asList("predict", "tp90")));
localPublisherConfig.put("timeAttribute", "visit_date");
streamConfig.setRoutes(Arrays.<HashMap<String, Object>>asList(localPublisherConfig));
statementsConfig.setStatementConfigs(Arrays.asList(streamConfig));
}
Aggregations