@Test
public void testExportMeter() {

    AlibabaMetricsExports exports = new AlibabaMetricsExports(clock);
    Meter meter = new MeterImpl(clock, 5, 1);
    MetricManager.getIMetricManager().register("test",
            MetricName.build("prom.test.meter").level(MetricLevel.CRITICAL), meter);
    for (int i = 0; i < 10; i++) {
        meter.mark();
    }
    clock.addSeconds(1);
    List<Collector.MetricFamilySamples> samples = exports.collect();
    Assert.assertEquals(5, samples.size());
    Assert.assertEquals("prom_test_meter_count", samples.get(0).name);
    Assert.assertEquals(10, samples.get(0).samples.get(0).value, 0.0001d);
    Assert.assertEquals("prom_test_meter_bucket_count", samples.get(4).name);
    Assert.assertEquals(10, samples.get(4).samples.get(0).value, 0.0001d);
}