docs: Map<String, MetricValues> encodeRegistry(
          Registry sourceRegistry, Predicate<Measurement> filter) {
      Map<String, MetricValues> metricMap = new HashMap<>();
  
      /*
       * Flatten the meter measurements into a map of measurements keyed by
       * the name and mapped to the different tag variants.
       */
      for (Meter meter : sourceRegistry) {
        String kind = knownMeterKinds.computeIfAbsent(
                           meter.id(), k -> meterToKind(sourceRegistry, meter));
  
        for (Measurement measurement : meter.measure()) {
          if (!filter.test(measurement)) {
            continue;
          }
          if (Double.isNaN(measurement.value())) {
            continue;
          }
  
          String meterName = measurement.id().name();
          MetricValues have = metricMap.get(meterName);
          if (have == null) {
            metricMap.put(meterName, new MetricValues(kind, measurement));
          } else {
            have.addMeasurement(measurement);
          }
        }
      }
      return metricMap;
    }