code: public final List<Metric> poll(MetricFilter filter, boolean reset) {
      Preconditions.checkNotNull(filter, "filter");
      List<Metric> metrics = pollImpl(reset);
      List<Metric> retained = metrics.stream().filter(m -> filter.matches(m.getConfig()))
          .collect(Collectors.toList());
      logger.debug("received {} metrics, retained {} metrics", metrics.size(), retained.size());
  
      return Collections.unmodifiableList(retained);
    }
docs: {@inheritDoc}