code: protected void addGarbageCollectionMetrics(Collection<Metric<?>> result) {
          List<GarbageCollectorMXBean> garbageCollectorMxBeans = ManagementFactory.getGarbageCollectorMXBeans();
          for (GarbageCollectorMXBean garbageCollectorMXBean : garbageCollectorMxBeans) {
              String name = beautifyGcName(garbageCollectorMXBean.getName());
              result.add(new Metric<>("gc." + name + ".count", garbageCollectorMXBean.getCollectionCount()));
              result.add(new Metric<>("gc." + name + ".time", garbageCollectorMXBean.getCollectionTime()));
          }
      }
docs: Add garbage collection metrics.
  
  @param result the result