Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ T register(final String name, final String description, final T sink) {
}
return sink;
}
allSinks.put(name, sink);
if (config != null) {
registerSink(name, description, sink);
}
Expand All @@ -301,6 +300,7 @@ synchronized void registerSink(String name, String desc, MetricsSink sink) {
? newSink(name, desc, sink, conf)
: newSink(name, desc, sink, config.subset(SINK_KEY));
sinks.put(name, sa);
allSinks.put(name, sink);
sa.start();
LOG.info("Registered sink "+ name);
}
Expand Down Expand Up @@ -508,6 +508,7 @@ private synchronized void configureSinks() {
conf.getString(DESC_KEY, sinkName), conf);
sa.start();
sinks.put(sinkName, sa);
allSinks.put(sinkName, sa.sink());
} catch (Exception e) {
LOG.warn("Error creating sink '"+ sinkName +"'", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ private void checkMetricsRecords(List<MetricsRecord> recs) {
r = recs.get(1);
assertTrue("NumActiveSinks should be 3", Iterables.contains(r.metrics(),
new MetricGaugeInt(MsInfo.NumActiveSinks, 3)));
assertTrue("NumAllSinks should be 3",
Iterables.contains(r.metrics(), new MetricGaugeInt(MsInfo.NumAllSinks, 3)));
}

@Test
Expand Down