/** * Returns a map of all the active reservoirs in the metrics system and their names which match the given filter. * * @param filter the active reservoir filter to match * @return all the active reservoirs in the metrics system */ public SortedMap<String, ActiveReservoir> getActiveReservoirs(ActiveReservoirFilter filter) { final TreeMap<String, ActiveReservoir> reservoirs = new TreeMap<>(); for (Map.Entry<String, ActiveReservoir> entry : activeReservoirs.entrySet()) { if (filter.matches(entry.getKey(), entry.getValue())) { reservoirs.put(entry.getKey(), entry.getValue()); } } return Collections.unmodifiableSortedMap(reservoirs); }
/** * Removes all active reservoirs which match the given filter. * * @param filter a filter */ public void removeActiveReservoirMatching(ActiveReservoirFilter filter) { for (Map.Entry<String, ActiveReservoir> entry : activeReservoirs.entrySet()) { if (filter.matches(entry.getKey(), entry.getValue())) { removeActiveReservoir(entry.getKey()); } } }
/** * Returns a map of all the active reservoirs in the metrics system and their names which match the given filter. * * @param filter the active reservoir filter to match * @return all the active reservoirs in the metrics system */ public SortedMap<String, ActiveReservoir> getActiveReservoirs(ActiveReservoirFilter filter) { final TreeMap<String, ActiveReservoir> reservoirs = new TreeMap<>(); for (Map.Entry<String, ActiveReservoir> entry : activeReservoirs.entrySet()) { if (filter.matches(entry.getKey(), entry.getValue())) { reservoirs.put(entry.getKey(), entry.getValue()); } } return Collections.unmodifiableSortedMap(reservoirs); }
/** * Removes all active reservoirs which match the given filter. * * @param filter a filter */ public void removeActiveReservoirMatching(ActiveReservoirFilter filter) { for (Map.Entry<String, ActiveReservoir> entry : activeReservoirs.entrySet()) { if (filter.matches(entry.getKey(), entry.getValue())) { removeActiveReservoir(entry.getKey()); } } }