@Test
public void test() throws InterruptedException {

    String baseUrl = "http://100.69.200.55:8242/";
    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);
}