DropwizardNodeStatsCollector implements NodeStatsCollector { protected String getName(final String key) { return MetricRegistry.name(DropwizardNodeStatsCollector.class, "node", key); } DropwizardNodeStatsCollector(); @Override void setNodeId(final String nodeId); void setReporterRegisrars(final List<DropwizardReporterRegistrar> reporters); @Override void stop(); @Override void messageReceived(final Object message); @Override void messageDiscarded(final Object message); @Override void messageSent(final Object message); @Override void messageNotSent(); @Override void setMessagesPendingGauge(final LongSupplier currentMessagesPendingGauge); @Override void setMessagesOutPendingGauge(final LongSupplier currentMessagesOutPendingGauge); static final String MESSAGE_RECEIVED; static final String MESSAGE_DISCARDED; static final String MESSAGE_SENT; static final String MESSAGE_NOT_SENT; static final String MESSAGES_PENDING_GAUGE; static final String MESSAGES_OUT_PENDING_GAUGE; static final String[] METRIC_NAMES; }
@Test public void verifyGetNameHasNecessaryPieces() { final String name = collector.getName("metric-name-goes-here"); Assert.assertTrue(name.contains("metric-name-goes-here")); }