Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD20418F71 for ; Tue, 5 May 2015 00:19:33 +0000 (UTC) Received: (qmail 11967 invoked by uid 500); 5 May 2015 00:19:33 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 11922 invoked by uid 500); 5 May 2015 00:19:33 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 11913 invoked by uid 99); 5 May 2015 00:19:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 00:19:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 00:19:29 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 306ED42F3D for ; Tue, 5 May 2015 00:19:07 +0000 (UTC) Received: (qmail 10542 invoked by uid 99); 5 May 2015 00:19:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 00:19:06 +0000 Date: Tue, 5 May 2015 00:19:06 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-1792) Improve TM Monitoring: CPU utilization, hide graphs by default and show summary only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FLINK-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14527617#comment-14527617 ] 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_r29636610 --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala --- @@ -129,6 +130,41 @@ class TaskManager(val connectionInfo: InstanceConnectionInfo, override def getValue: Double = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage() }) + + // Preprocessing steps for registering cpuLoad + // fetch the method to get process CPU load + val getCPULoadMethod: Method = getMethodToFetchCPULoad() + + // 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) => { + log.warning("getProcessCpuLoad method not available in the Operating System Bean" + + "implementation for this Java runtime environment",Thread.currentThread().getStackTrace) + -1 + } + } + + metricRegistry.register("cpuLoad", new Gauge[Double] { + override def getValue: Double = { + try{ + val osMXBean = ManagementFactory.getOperatingSystemMXBean(). + asInstanceOf[com.sun.management.OperatingSystemMXBean] + return fetchCPULoad(osMXBean) + } catch { + case t:Throwable => { + if (t.isInstanceOf[java.lang.ClassCastException]){ + log.warning("Error casting to OperatingSystemMXBean",t) --- End diff -- No, this error is not occurring for each heartbeat. This is in case there is a new error while using the getProcessCpuLoad method. I will remove the ClassCastException and make it Throwable so as to catch all types of errors. > 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)