@Test
public void testExportGauge() {

    AlibabaMetricsExports exports = new AlibabaMetricsExports(clock);
    final double random = Math.random();
    Gauge<Double> gauge = new Gauge<Double>() {
        @Override
        public Double getValue() {
            return random;
        }
        @Override
        public long lastUpdateTime() {
            return 0;
        }
    };
    MetricManager.getIMetricManager().register("test",
            MetricName.build("prom.test.gauge"), gauge);
    List<Collector.MetricFamilySamples> samples = exports.collect();
    Assert.assertEquals(1, samples.size());
    Assert.assertEquals("prom_test_gauge", samples.get(0).name);
    Assert.assertEquals(random, samples.get(0).samples.get(0).value, 0.0001d);
}