code: @Override
    public void getMetrics(MetricsCollector collector, boolean all) {
      MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("sparkShuffleService");
  
      for (Map.Entry<String, Metric> entry : metricSet.getMetrics().entrySet()) {
        collectMetric(metricsRecordBuilder, entry.getKey(), entry.getValue());
      }
    }
docs: Get metrics from the source
  
  @param collector to contain the resulting metrics snapshot
  @param all       if true, return all metrics even if unchanged.