@Test
public void test() throws InterruptedException {

    String baseUrl = "http://100.69.200.55:8242/";
    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 {
eporter.start(period, TimeUnit.SECONDS);
catch (Exception e) {
/ TODO Auto-generated catch block
.printStackTrace();
    metricRegistry.register("jvm.mem", new MemoryUsageGaugeSet());
    metricRegistry.register("jvm.gc", new GarbageCollectorMetricSet());
    TimeUnit.SECONDS.sleep(6);
}