code: protected void addHeapMetrics(Collection<Metric<?>> result) {
          MemoryUsage memoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
          result.add(newMemoryMetric("heap.committed", memoryUsage.getCommitted()));
          result.add(newMemoryMetric("heap.init", memoryUsage.getInit()));
          result.add(newMemoryMetric("heap.used", memoryUsage.getUsed()));
          result.add(newMemoryMetric("heap", memoryUsage.getMax()));
      }
docs: Add JVM heap metrics.
  
  @param result the result