code: public void stopMetricsReporting() {
      LOGGER.info("Metrics reporting will be stopped: GobblinMetrics {}", this.toString());
  
      if (!this.metricsReportingStarted) {
        LOGGER.warn("Metric reporting has not started yet");
        return;
      }
  
      // Stop the JMX reporter
      if (this.jmxReporter.isPresent()) {
        this.jmxReporter.get().stop();
      }
  
      // Trigger and stop reporters that implement org.apache.gobblin.metrics.report.ScheduledReporter
      RootMetricContext.get().stopReporting();
  
      // Trigger and stop reporters that implement com.codahale.metrics.ScheduledReporter
  
      for (com.codahale.metrics.ScheduledReporter scheduledReporter : this.codahaleScheduledReporters) {
        scheduledReporter.report();
      }
  
      try {
        this.codahaleReportersCloser.close();
      } catch (IOException ioe) {
        LOGGER.error("Failed to close metric output stream for job " + this.id, ioe);
      } catch (Exception e) {
        LOGGER.error("Failed to close metric output stream for job {} due to {}", this.id, ExceptionUtils.getFullStackTrace(e));
        throw e;
      }
  
      this.metricsReportingStarted = false;
      // Remove from the cache registry
      GobblinMetrics.remove(id);
      LOGGER.info("Metrics reporting stopped successfully");
    }
docs: Stop metric reporting.