OpenTsdbMetricManagerReporter extends MetricManagerReporter { public static Builder forMetricManager(IMetricManager metricManager) { return new Builder(metricManager); } private  OpenTsdbMetricManagerReporter(IMetricManager metricManager, OpenTsdb opentsdb, Clock clock, String prefix, TimeUnit rateUnit,
            TimeUnit durationUnit, TimeUnit timestampPrecision, MetricFilter filter, MetricsCollectPeriodConfig metricsReportPeriodConfig, Map<String, String> globalTags); static Builder forMetricManager(IMetricManager metricManager); @Override void report(Map<MetricName, Gauge> gauges, Map<MetricName, Counter> counters,
            Map<MetricName, Histogram> histograms, Map<MetricName, Meter> meters,
            Map<MetricName, Timer> timers, Map<MetricName, Compass> compasses, Map<MetricName, FastCompass> fastCompasses, Map<MetricName, ClusterHistogram> clusterHistogrames);  }
@Test public void test() throws InterruptedException { String baseUrl = "http: OpenTsdb opentsdb = OpenTsdb.forService(baseUrl) .withReadTimeout(20000) .create(); IMetricManager metricManager = MetricManager.getIMetricManager(); MetricRegistry metricRegistry= metricManager.getMetricRegistryByGroup("opentsdb"); OpenTsdbMetricManagerReporter reporter = OpenTsdbMetricManagerReporter.forMetricManager(metricManager) .withGlobalTags(Collections.singletonMap("foo", "bar")) .timestampPrecision(TimeUnit.MILLISECONDS) .build(opentsdb); long period = 3; try { reporter.start(period, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); } metricRegistry.register("jvm.mem", new MemoryUsageGaugeSet()); metricRegistry.register("jvm.gc", new GarbageCollectorMetricSet()); TimeUnit.SECONDS.sleep(6); }