```
public class CpuGaugeSet implements MetricSet {
  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(CpuGaugeSet.class);

  private final RuntimeMXBean rtMXBean;
  private final OperatingSystemMXBean osMXBean;

  public CpuGaugeSet() {
    //DRILL-6702: Instead of worrying about compiling with IBM JDK, for now, we 
shall provide no CPU metrics for non-HotSpot JVMs
    this.rtMXBean = ManagementFactory.getRuntimeMXBean();
    java.lang.management.OperatingSystemMXBean operatingSystemMXBean = 
ManagementFactory.getOperatingSystemMXBean();
    if (operatingSystemMXBean instanceof OperatingSystemMXBean) {
      this.osMXBean = (OperatingSystemMXBean) 
ManagementFactory.getOperatingSystemMXBean();
    } else {
      this.osMXBean = null;
      logger.warn("Detected non-HotSpot JVM [{}]. CPU Metrics in the WebUI will 
not be available!", System.getProperty("java.vm.name"));
    }
  }
...
```

[ Full content available at: https://github.com/apache/drill/pull/1437 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to