[ https://issues.apache.org/jira/browse/FLINK-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532173#comment-14532173 ]
ASF GitHub Bot commented on FLINK-1792: --------------------------------------- Github user rmetzger commented on the pull request: https://github.com/apache/flink/pull/553#issuecomment-99753925 The code looks much better now. The only thing that makes me still unhappy is the following method ```diff + override def getValue: Double = { + try{ + val osMXBean = ManagementFactory.getOperatingSystemMXBean(). + asInstanceOf[com.sun.management.OperatingSystemMXBean] + fetchCPULoad.map(_.invoke(osMXBean).asInstanceOf[Double]).getOrElse(-1) + } catch { + case t: Throwable => { + LOG.warn("Error retrieving CPU Load through OperatingSystemMXBean", t) + -1 + } + } + } ``` This `getValue()` method is called every 5 seconds to get the metrics from each machine. Users using Java 6 will get the WARN in their log + the exception because the cast to `com.sun.management.OperatingSystemMXBean` will fail every time. I would do the following: If you detect that fetchCpuLoad is null, register a gauge which is always returning -1. Otherwise, register the gauge which is calling fetchCpuLoad. > Improve TM Monitoring: CPU utilization, hide graphs by default and show > summary only > ------------------------------------------------------------------------------------ > > Key: FLINK-1792 > URL: https://issues.apache.org/jira/browse/FLINK-1792 > Project: Flink > Issue Type: Sub-task > Components: Webfrontend > Affects Versions: 0.9 > Reporter: Robert Metzger > Assignee: Sachin Bhat > > As per https://github.com/apache/flink/pull/421 from FLINK-1501, there are > some enhancements to the current monitoring required > - Get the CPU utilization in % from each TaskManager process > - Remove the metrics graph from the overview and only show the current stats > as numbers (cpu load, heap utilization) and add a button to enable the > detailed graph. -- This message was sent by Atlassian JIRA (v6.3.4#6332)