ZookeeperCounterStorage implements CounterStorage { @Override public void setTopicPublishedCounter(TopicName topicName, long count) { String topicPublishedCounter = topicPublishedCounter(topicName); incrementSharedCounter(topicPublishedCounter, count); } @Inject  ZookeeperCounterStorage(SharedCounter sharedCounter,
                                   SubscriptionRepository subscriptionRepository,
                                   PathsCompiler pathsCompiler,
                                   ConfigFactory configFactory); @Override void setTopicPublishedCounter(TopicName topicName, long count); @Override long getTopicPublishedCounter(TopicName topicName); @Override long getSubscriptionDeliveredCounter(TopicName topicName, String subscriptionName); @Override void setSubscriptionDeliveredCounter(TopicName topicName, String subscriptionName, long count); @Override void setSubscriptionDiscardedCounter(TopicName topicName, String subscriptionName, long count); @Override void incrementVolumeCounter(TopicName topicName, String subscriptionName, long value); @Override void incrementVolumeCounter(TopicName topicName, long value);  }
@Test public void shouldIncrementTopicMetricUsingSharedCounter() { storage.setTopicPublishedCounter(TopicName.fromQualifiedName("test.topic"), 10); verify(sharedCounter).increment("/hermes/groups/test/topics/topic/metrics/published", 10); }