/** * Registers a Source. * * @param source the source to register */ public void registerSource(Source source) { mSources.add(source); try { mMetricRegistry.register(source.getName(), source.getMetricRegistry()); } catch (IllegalArgumentException e) { LOG.warn("Metrics already registered. Exception:" + e.getMessage()); } }
/** * Removes a Source. * * @param source the source to remove */ public void removeSource(Source source) { mSources.remove(source); mMetricRegistry.remove(source.getName()); }