[ 
https://issues.apache.org/jira/browse/FLINK-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14531107#comment-14531107
 ] 

ASF GitHub Bot commented on FLINK-1792:
---------------------------------------

Github user bhatsachin commented on a diff in the pull request:

    https://github.com/apache/flink/pull/553#discussion_r29786547
  
    --- Diff: 
flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
 ---
    @@ -1894,6 +1895,52 @@ object TaskManager {
           override def getValue: Double =
             ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage()
         })
    +    // Preprocessing steps for registering cpuLoad
    +    // fetch the method to get process CPU load
    +    val getCPULoadMethod: Method = getMethodToFetchCPULoad()
    +
    +    // Log getProcessCpuLoad method not available for Java 6
    +    if(getCPULoadMethod == null){
    +      LOG.warn("getProcessCpuLoad method not available in the Operating 
System Bean" +
    +      "implementation for this Java runtime 
environment\n"+Thread.currentThread().getStackTrace)
    +    }
    +
    +    // define the fetchCPULoad method as per the fetched getCPULoadMethod
    +    val fetchCPULoad: (Any) => Double = if (getCPULoadMethod != null) {
    +      (obj: Any) => getCPULoadMethod.invoke(obj).asInstanceOf[Double]
    +    } else {
    +      (obj: Any) => -1
    +    }
    +
    +    metricRegistry.register("cpuLoad", new Gauge[Double] {
    +      override def getValue: Double = {
    +        try{
    --- End diff --
    
    Awesome :). These features in Scala are just too good :D


> 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)

Reply via email to