AvgLabeledFunction extends Metrics implements AcceptableValue<DataTable>, LabeledValueHolder { @Override public void accept(final MeterEntity entity, final DataTable value) { this.entityId = entity.id(); this.serviceId = entity.serviceId(); this.summation.append(value); DataTable c = new DataTable(); value.keys().forEach(key -> c.put(key, 1L)); this.count.append(c); }  @Override final void combine(Metrics metrics); @Override final void calculate(); @Override Metrics toHour(); @Override Metrics toDay(); @Override int remoteHashCode(); @Override void deserialize(final RemoteData remoteData); @Override RemoteData.Builder serialize(); @Override String id(); @Override void accept(final MeterEntity entity, final DataTable value); @Override Class<? extends AvgLabeledStorageBuilder> builder(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testAccept() { function.accept(MeterEntity.newService("request_count"), build(asList("200", "404"), asList(10L, 2L))); assertResult(asList("200", "404"), asList(10L, 2L), asList(1L, 1L)); function.accept(MeterEntity.newService("request_count"), build(asList("200", "500"), asList(2L, 3L))); assertResult(asList("200", "404", "500"), asList(12L, 2L, 3L), asList(2L, 1L, 1L)); }