DropwizardClusterStatsCollector implements ClusterStatsCollector { protected String getName(final String key) { return MetricRegistry.name(DropwizardClusterStatsCollector.class, "cluster", clusterId.applicationName, clusterId.clusterName, key); } DropwizardClusterStatsCollector(final ClusterId clusterId); @Override void messageDispatched(final int num); @Override void messageProcessed(final int num); @Override void messageFailed(final int num); @Override void messageCollision(final Object message); @Override void messageDiscarded(final Object message); @Override void messageProcessorCreated(final Object key); @Override void messageProcessorDeleted(final Object key); @Override void stop(); @Override TimerContext preInstantiationStarted(); @Override TimerContext outputInvokeStarted(); @Override TimerContext evictionPassStarted(); static final String MESSAGES_DISPATCHED; static final String MESSAGES_PROCESSED; static final String MESSAGES_FAILED; static final String MESSAGES_COLLISION; static final String MESSAGES_DISCARDED; static final String MESSAGES_PENDING; static final String MESSAGES_PROCESSOR_CREATED; static final String MESSAGES_PROCESSOR_DELETED; static final String OUTPUT_INVOKE_STARTED_TIMER; static final String EVICTION_PASS_STARTED_TIMER; static final String PRE_INSTANTIATION_STARTED_TIMER; static final String[] METRIC_NAMES; }
@Test public void verifyGetNameHasNecessaryPieces() { final String name = collector.getName("metric-name-goes-here"); Assert.assertTrue(name.contains("appName")); Assert.assertTrue(name.contains("clusterName")); Assert.assertTrue(name.contains("metric-name-goes-here")); }