SemanticAggregatorMetricRegistry implements RemoteSemanticMetricRegistry { @Override public RemoteMeter meter(final MetricId name) { return meter(name, ImmutableList.of("what")); } SemanticAggregatorMetricRegistry(
        String remoteHost,
        int port,
        int maxConcurrency,
        int hwm); @VisibleForTesting  SemanticAggregatorMetricRegistry(Remote remote); T getOrAdd(
        final MetricId name,
        final List<String> shardKey,
        final SemanticAggregatorMetricBuilder<T> builder
    ); @Override RemoteCounter counter(MetricId name); @Override RemoteCounter counter(MetricId name, List<String> shardKey); @Override RemoteTimer timer(MetricId name); @Override RemoteTimer timer(MetricId name, List<String> shardKey); @Override RemoteDerivingMeter derivingMeter(MetricId name, List<String> shardKey); @Override RemoteDerivingMeter derivingMeter(MetricId name); @Override RemoteHistogram histogram(final MetricId name); @Override RemoteHistogram histogram(final MetricId name, final List<String> shardKey); @Override RemoteMeter meter(final MetricId name); @Override RemoteMeter meter(final MetricId name, final List<String> shardKey); @Override boolean shutdown(long timeout, TimeUnit timeUnit);  }
@Test public void createMeterTest() { assertNotNull(registry.meter(MetricId.build("X").tagged("what", "balls"))); }
@Test public void meterBump1Test() { registry.meter(MetricId.build("X").tagged("what", "balls", "status", "tripping")).mark(); verify(remote).post("/", "what:balls", ImmutableMap.of( "type", "metric", "value", "1", "key", "X", "attributes", ImmutableMap.of( "metric_type", "meter", "status", "tripping", "what", "balls"))); }
@Test public void meterBump5Test() { registry.meter(MetricId.build("X").tagged("what", "balls", "status", "tripping")).mark(5); verify(remote).post("/", "what:balls", ImmutableMap.of( "type", "metric", "value", "5", "key", "X", "attributes", ImmutableMap.of( "metric_type", "meter", "status", "tripping", "what", "balls"))); }
@Test public void meterShardTest() { registry.meter( MetricId.build("X").tagged("what", "balls", "status", "tripping"), ImmutableList.of("what", "status")).mark(); verify(remote).post(anyString(), eq("what:balls,status:tripping"), anyMap()); }
@Test public void meterUniquenessTest() { RemoteMeter a = registry.meter(MetricId.build("X").tagged("what", "balls", "status", "tripping")); RemoteMeter b = registry.meter(MetricId.build("X").tagged("what", "balls", "status", "tripping")); assert (a == b); }