You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by ra...@apache.org on 2020/02/19 01:34:42 UTC

[samza] branch master updated: SAMZA-2462 : Adding metric for container thread pool size (#1279)

This is an automated email from the ASF dual-hosted git repository.

rayman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git


The following commit(s) were added to refs/heads/master by this push:
     new 031b5e2  SAMZA-2462 : Adding metric for container thread pool size (#1279)
031b5e2 is described below

commit 031b5e2a682e002fbd6ca8184e53fd99ede5db0b
Author: rmatharu <40...@users.noreply.github.com>
AuthorDate: Tue Feb 18 17:34:32 2020 -0800

    SAMZA-2462 : Adding metric for container thread pool size (#1279)
    
    * Adding metric for container thread pool size
    
    * Triggering a build
---
 docs/learn/documentation/versioned/container/metrics-table.html       | 4 ++++
 .../src/main/scala/org/apache/samza/container/SamzaContainer.scala    | 1 +
 .../main/scala/org/apache/samza/container/SamzaContainerMetrics.scala | 1 +
 3 files changed, 6 insertions(+)

diff --git a/docs/learn/documentation/versioned/container/metrics-table.html b/docs/learn/documentation/versioned/container/metrics-table.html
index c895fca..697cba5 100644
--- a/docs/learn/documentation/versioned/container/metrics-table.html
+++ b/docs/learn/documentation/versioned/container/metrics-table.html
@@ -218,6 +218,10 @@
         <td>The physical memory used by the Samza container process (native + on heap) (in megabytes)</td>
     </tr>
     <tr>
+        <td>container-thread-pool-size</td>
+        <td>The size of the thread pool used by the Samza container for input processing, configured using job.container.thread.pool.size.</td>
+    </tr>
+    <tr>
         <td>container-startup-time</td>
         <td><a href="#average-time">Average time</a> spent for the container to startup</td>
     </tr>
diff --git a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
index 092175d..a9b0417 100644
--- a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
+++ b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
@@ -467,6 +467,7 @@ object SamzaContainer extends Logging {
 
     val threadPoolSize = jobConfig.getThreadPoolSize
     info("Got thread pool size: " + threadPoolSize)
+    samzaContainerMetrics.containerThreadPoolSize.set(threadPoolSize)
 
     val taskThreadPool = if (threadPoolSize > 0) {
       Executors.newFixedThreadPool(threadPoolSize,
diff --git a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala
index 1beb3dd..e0b2fdc 100644
--- a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala
+++ b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala
@@ -46,6 +46,7 @@ class SamzaContainerMetrics(
   val diskQuotaBytes = newGauge("disk-quota-bytes", Long.MaxValue)
   val executorWorkFactor = newGauge("executor-work-factor", 1.0)
   val physicalMemoryMb = newGauge[Double]("physical-memory-mb", 0.0F)
+  val containerThreadPoolSize = newGauge("container-thread-pool-size", 0L)
 
   val taskStoreRestorationMetrics: util.Map[TaskName, Gauge[Long]] = new util.HashMap[TaskName, Gauge[Long]]()