Class JvmGcCollector

java.lang.Object
io.fluxzero.sdk.tracking.metrics.host.collectors.JvmGcCollector
All Implemented Interfaces:
MetricCollector<JvmGcMetrics>

public class JvmGcCollector extends Object implements MetricCollector<JvmGcMetrics>
Collector for JVM garbage collection metrics using JMX.
  • Constructor Details

    • JvmGcCollector

      public JvmGcCollector()
  • Method Details

    • collect

      public Optional<JvmGcMetrics> collect()
      Description copied from interface: MetricCollector
      Collects metrics.
      Specified by:
      collect in interface MetricCollector<JvmGcMetrics>
      Returns:
      an Optional containing the collected metrics, or empty if collection failed or the metrics are not available on this platform
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: MetricCollector
      Checks if this collector is available on the current platform.

      This method should return quickly and may cache its result.

      Specified by:
      isAvailable in interface MetricCollector<JvmGcMetrics>
      Returns:
      true if this collector can collect metrics on the current platform