NoopMetricsFactory implements MetricsFactory { @Override public Gauge createGauge(final String name, final Map<String, String> tags) { return new Gauge() { @Override public void update(long amount) { } }; }  @Override Counter createCounter(String name, Map<String, String> tags); @Override Timer createTimer(final String name, final Map<String, String> tags); @Override Gauge createGauge(final String name, final Map<String, String> tags);  }
@Test public void metricNameIsUsedForGauge() { Map<String, String> tags = new HashMap<>(1); tags.put("foo", "bar"); NoopMetricsFactory metricsFactory = new NoopMetricsFactory(); metricsFactory.createGauge("thegauge", tags); }
@Test public void gaugeValueIsIncreased() { Map<String, String> tags = new HashMap<>(1); tags.put("foo", "bar"); NoopMetricsFactory metricsFactory = new NoopMetricsFactory(); Gauge gauge = metricsFactory.createGauge("thegauge", tags); gauge.update(1); }