@Override
  public void start() {
    try {
      executor.scheduleWithFixedDelay(new Runnable() {
        @Override
        public void run() {
          try {
            LOG.debug("Publishing JVM metrics to sink");
            sink.publish(getMetrics());
          } catch (Exception e) {
            LOG.debug("Error in publishing JVM metrics to sink.");
          }
        }
      }, interval, interval, TimeUnit.SECONDS);
      LOG.info("Started JVM Metrics source...");
    } catch (Exception e) {
      LOG.info("Throwing exception when starting metric source", e);
    }
  }
@{link JvmMetricsSource} collects JVM Metrics using codahale and publish to Metrics Sink.
ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java