Package org.elasticsearch.metrics

Examples of org.elasticsearch.metrics.ElasticsearchReporter


    public void run() throws Exception {
        startElasticsearchIfNecessary();
        createIndexAndMappingIfNecessary();

        // index into the metrics index without date formatting
        ElasticsearchReporter reporter = ElasticsearchReporter.forRegistry(registry)
                .hosts("localhost:9200")
                .indexDateFormat("")
                .percolationNotifier(new HttpNotifier())
                .percolationFilter(MetricFilter.ALL)
                .build();
        reporter.start(60, TimeUnit.SECONDS);

        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        ObjectReader reader = objectMapper.reader(Map.class);
        MappingIterator<Map<String, Object>> iterator = reader.readValues(getInputStream());
View Full Code Here


    public static void main(String[] args) throws Exception {

        // configure reporter
        final MetricRegistry metrics = new MetricRegistry();
        ElasticsearchReporter reporter = ElasticsearchReporter.forRegistry(metrics)
                                            // support for several es nodes
                                            .hosts("localhost:9200", "localhost:9201")
                                            // just create an index, no date format, means one index only
                                            .index("metrics")
                                            .indexDateFormat(null)
                                            // define a percolation check on all metrics
                                            .percolationFilter(MetricFilter.ALL)
                                            .percolationNotifier(new SystemOutNotifier())
                                            //.percolationNotifier(new HttpNotifier())
                                            .build();
        // usually you set this to one minute
        reporter.start(10, TimeUnit.SECONDS);

        // start up background thread
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        executorService.submit(new StreamMeetupComTask(metrics));
View Full Code Here

TOP

Related Classes of org.elasticsearch.metrics.ElasticsearchReporter

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.