@Override
  public void init(MetricsConfiguration configuration, MetricsSink sink) {
    super.init(configuration, sink);
    registerAll(JVM_PREFIX + ".gc", new GarbageCollectorMetricSet(), registry);
    registerAll(JVM_PREFIX + ".buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()), registry);
    registerAll(JVM_PREFIX + ".memory", new MemoryUsageGaugeSet(), registry);
    registerAll(JVM_PREFIX + ".threads", new ThreadStatesGaugeSet(), registry);
    registry.register(JVM_PREFIX + ".file.open.descriptor.ratio", new FileDescriptorRatioGauge());
    interval = Integer.parseInt(configuration.getProperty("interval", "10"));
    LOG.info("Initialized JVM Metrics source...");
  }
@{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