@Test public void test() throws InterruptedException { String baseUrl = "http: OpenTsdb opentsdb = OpenTsdb.forService(baseUrl) .withReadTimeout(20000) .create(); OpenTsdbReporter openTsdbReporter = OpenTsdbReporter.forRegistry(metrics) .withGlobalTags(Collections.singletonMap("foo", "bar")) .timestampPrecision(TimeUnit.MILLISECONDS) .build(opentsdb); long period = 3; openTsdbReporter.start(period, TimeUnit.SECONDS); metrics.register("jvm.mem", new MemoryUsageGaugeSet()); metrics.register("jvm.gc", new GarbageCollectorMetricSet()); TimeUnit.SECONDS.sleep(6); }
public static Builder forRegistry(MetricRegistry registry) { return new Builder(registry); }
OpenTsdbReporter extends ScheduledReporter { public static Builder forRegistry(MetricRegistry registry) { return new Builder(registry); } }
OpenTsdbReporter extends ScheduledReporter { public static Builder forRegistry(MetricRegistry registry) { return new Builder(registry); } private  OpenTsdbReporter(MetricRegistry registry, OpenTsdb opentsdb, Clock clock, String prefix, TimeUnit rateUnit,
            TimeUnit durationUnit, TimeUnit timestampPrecision, MetricFilter filter, Map<String, String> globalTags); }
OpenTsdbReporter extends ScheduledReporter { public static Builder forRegistry(MetricRegistry registry) { return new Builder(registry); } private  OpenTsdbReporter(MetricRegistry registry, OpenTsdb opentsdb, Clock clock, String prefix, TimeUnit rateUnit,
            TimeUnit durationUnit, TimeUnit timestampPrecision, MetricFilter filter, Map<String, String> globalTags); static Builder forRegistry(MetricRegistry registry); @Override void report(SortedMap<MetricName, Gauge> gauges, SortedMap<MetricName, Counter> counters,
            SortedMap<MetricName, Histogram> histograms, SortedMap<MetricName, Meter> meters,
            SortedMap<MetricName, com.alibaba.metrics.Timer> timers); }
OpenTsdbReporter extends ScheduledReporter { public static Builder forRegistry(MetricRegistry registry) { return new Builder(registry); } private  OpenTsdbReporter(MetricRegistry registry, OpenTsdb opentsdb, Clock clock, String prefix, TimeUnit rateUnit,
            TimeUnit durationUnit, TimeUnit timestampPrecision, MetricFilter filter, Map<String, String> globalTags); static Builder forRegistry(MetricRegistry registry); @Override void report(SortedMap<MetricName, Gauge> gauges, SortedMap<MetricName, Counter> counters,
            SortedMap<MetricName, Histogram> histograms, SortedMap<MetricName, Meter> meters,
            SortedMap<MetricName, com.alibaba.metrics.Timer> timers);  }