SemanticFolsomMetrics implements Metrics { @Override public void registerOutstandingRequestsGauge(final OutstandingRequestsGauge gauge) { gauges.add(gauge); } SemanticFolsomMetrics(final SemanticMetricRegistry registry, final MetricId baseMetricId); @Override void measureGetFuture(CompletionStage<GetResult<byte[]>> future); @Override void measureSetFuture(CompletionStage<MemcacheStatus> future); @Override void measureMultigetFuture(CompletionStage<List<GetResult<byte[]>>> future); @Override void measureDeleteFuture(CompletionStage<MemcacheStatus> future); @Override void measureIncrDecrFuture(CompletionStage<Long> future); @Override void measureTouchFuture(CompletionStage<MemcacheStatus> future); Timer getGets(); Meter getGetHits(); Meter getGetMisses(); Meter getGetFailures(); Timer getSets(); Meter getSetSuccesses(); Meter getSetFailures(); Timer getMultigets(); Meter getMultigetSuccesses(); Meter getMultigetFailures(); Timer getDeletes(); Meter getDeleteSuccesses(); Meter getDeleteFailures(); Timer getIncrDecrs(); Meter getIncrDecrSuccesses(); Meter getIncrDecrFailures(); Timer getTouches(); Meter getTouchSuccesses(); Meter getTouchFailures(); RatioGauge getHitRatio(); @Override void registerOutstandingRequestsGauge(final OutstandingRequestsGauge gauge); @Override void unregisterOutstandingRequestsGauge(OutstandingRequestsGauge gauge);  }
@Test public void testRegisterOutstandingRequestsGauge() { metrics.registerOutstandingRequestsGauge(GAUGE); @SuppressWarnings("rawtypes") final SortedMap<MetricId, Gauge> gauges = registry.getGauges( (name, metric) -> "outstanding-requests".equals(name.getTags().get("what"))); assertEquals(1, gauges.size()); assertEquals(123L, gauges.values().iterator().next().getValue()); }
@Test public void testRegisterOutstandingRequestsGaugeDuplicate() { metrics.registerOutstandingRequestsGauge(GAUGE); metrics.registerOutstandingRequestsGauge(GAUGE); }