BasicMetricsCollector implements IMetricsCollector { boolean collectThroughputMB(Set<MetricsItem> items) { return items.contains(MetricsItem.ALL) || items.contains(MetricsItem.THROUGHPUT_IN_MB); } BasicMetricsCollector(Config stormConfig, StormTopology topology, Set<MetricsItem> items); @Override void run(); Nimbus.Client getNimbusClient(Config stormConfig); static final String TIME; static final String TIME_FORMAT; static final String TOTAL_SLOTS; static final String USED_SLOTS; static final String WORKERS; static final String TASKS; static final String EXECUTORS; static final String TRANSFERRED; static final String THROUGHPUT; static final String THROUGHPUT_MB; static final String THROUGHPUT_MB_FORMAT; static final String SPOUT_EXECUTORS; static final String SPOUT_TRANSFERRED; static final String SPOUT_ACKED; static final String SPOUT_THROUGHPUT; static final String SPOUT_THROUGHPUT_MB; static final String SPOUT_THROUGHPUT_MB_FORMAT; static final String SPOUT_AVG_COMPLETE_LATENCY; static final String SPOUT_AVG_LATENCY_FORMAT; static final String SPOUT_MAX_COMPLETE_LATENCY; static final String SPOUT_MAX_LATENCY_FORMAT; static final String ALL_TIME; static final String LAST_TEN_MINS; static final String LAST_THREE_HOURS; static final String LAST_DAY; }
@Test(dataProvider = "getThroughputMBMetrics") public void testCollectThroughputMB(Set<MetricsItem> items, boolean expected) { BasicMetricsCollector collector = new BasicMetricsCollector(config, topology, items); assertThat(collector.collectThroughputMB).isEqualTo(expected); }