code: @Override
      public void removeMatching(MetricFilter filter) {
          for (Map.Entry<String, Metric> entry : metrics.entrySet()) {
              if (filter.matches(entry.getKey(), entry.getValue())) {
                  remove(entry.getKey());
              }
          }
      }
docs: Removes all metrics which match the given filter.
  
  @param filter a filter