Class UptimeCollector

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

public class UptimeCollector extends Object implements MetricCollector<UptimeMetrics>
Collector for JVM uptime metrics using JMX.
  • Constructor Details

    • UptimeCollector

      public UptimeCollector()
  • Method Details

    • collect

      public Optional<UptimeMetrics> collect()
      Description copied from interface: MetricCollector
      Collects metrics.
      Specified by:
      collect in interface MetricCollector<UptimeMetrics>
      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<UptimeMetrics>
      Returns:
      true if this collector can collect metrics on the current platform