Package com.ning.metrics.meteo.binder

Examples of com.ning.metrics.meteo.binder.StreamConfig


        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));
    }
View Full Code Here


    @Test(groups = "fast")
    public void testInstantiateListener() throws Exception
    {
        final PublishersCompiler compiler = new PublishersCompiler(statementsConfig.getPublishers(), new ArrayList<StreamConfig>(), null);
        final StreamConfig streamConfig = statementsConfig.getStatements().get(0);
        compiler.configurePublishersForStream(streamConfig);

        final String streamName = streamConfig.getName();
        final PublisherConfig publisherConfig = compiler.getStreamConfigs().get(streamName).getPublishers().get(0);
        assertTrue(publisherConfig instanceof DummyPublisherConfig);

        final DummyPublisherConfig config = (DummyPublisherConfig) publisherConfig;
        assertEquals(config.getName(), "OpenTSDB");
View Full Code Here

TOP

Related Classes of com.ning.metrics.meteo.binder.StreamConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.