You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/02 07:43:12 UTC

[GitHub] [ignite] dmekhanikov commented on a change in pull request #8903: IGNITE-13399 Fix access right issues in computation of system metrics.

dmekhanikov commented on a change in pull request #8903:
URL: https://github.com/apache/ignite/pull/8903#discussion_r606116999



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/metric/GridMetricManager.java
##########
@@ -840,9 +841,10 @@ private double getCpuLoad() {
             long cpuTime;
 
             try {
-                cpuTime = U.<Long>property(os, "processCpuTime");
+                com.sun.management.OperatingSystemMXBean sunOs = (com.sun.management.OperatingSystemMXBean) os;
+                cpuTime = sunOs.getProcessCpuTime();
             }
-            catch (IgniteException ignored) {
+            catch (ClassCastException ignored) {

Review comment:
       I don't think it ever happens, but I don't mind replacing `ClassCastException` with `Exception`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org