< prev index next >

src/java.base/share/classes/jdk/internal/platform/Metrics.java

Print this page
@  rev 56863 : 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
|  Reviewed-by: bobv
~

*** 54,66 **** * * @return Metrics object or null if not supported on this platform. */ public static Metrics systemMetrics() { try { ! // We currently only support cgroupv1 ! Class<?> c = Class.forName("jdk.internal.platform.cgroupv1.Metrics"); ! @SuppressWarnings("unchecked") Method m = c.getMethod("getInstance"); return (Metrics) m.invoke(null); } catch (ClassNotFoundException e) { return null; } catch (ReflectiveOperationException e) { --- 54,64 ---- * * @return Metrics object or null if not supported on this platform. */ public static Metrics systemMetrics() { try { ! Class<?> c = Class.forName("jdk.internal.platform.CgroupMetrics"); Method m = c.getMethod("getInstance"); return (Metrics) m.invoke(null); } catch (ClassNotFoundException e) { return null; } catch (ReflectiveOperationException e) {
< prev index next >