You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by kiszk <gi...@git.apache.org> on 2018/09/01 05:29:12 UTC

[GitHub] spark pull request #22218: [SPARK-25228][CORE]Add executor CPU time metric.

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

    https://github.com/apache/spark/pull/22218#discussion_r214505265
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorSource.scala ---
    @@ -73,6 +75,29 @@ class ExecutorSource(threadPool: ThreadPoolExecutor, executorId: String) extends
         registerFileSystemStat(scheme, "write_ops", _.getWriteOps(), 0)
       }
     
    +  /** Dropwizard metrics gauge measuring the executor's process CPU time.
    +   *  This code will try to get JVM Process CPU time or return -1 otherwise.
    +   *  The CPU time value is returned in nanoseconds.
    +   *  It will use proprietary extensions as com.sun.management.OperatingSystemMXBean or
    +   *  com.ibm.lang.management.OperatingSystemMXBean if available
    +   */
    +  val mBean: MBeanServer = ManagementFactory.getPlatformMBeanServer
    +  val name = new ObjectName("java.lang", "type", "OperatingSystem")
    +  metricRegistry.register(MetricRegistry.name("executorCPUTime" ), new Gauge[Long] {
    --- End diff --
    
    nit: `name("executorCPUTime" )` -> `name("executorCPUTime")`



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org