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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5308cf0607 Adding a metric to measure total thread cpu time for a 
table (#11713)
5308cf0607 is described below

commit 5308cf0607054bc0a0d40c7849a08eb5cc2784c4
Author: Subbu Subramaniam <[email protected]>
AuthorDate: Mon Oct 2 09:45:34 2023 -0700

    Adding a metric to measure total thread cpu time for a table (#11713)
---
 .../src/main/java/org/apache/pinot/common/metrics/ServerMeter.java     | 3 ++-
 .../java/org/apache/pinot/core/query/scheduler/QueryScheduler.java     | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java 
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java
index 09701ed335..ce2a4e0cda 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerMeter.java
@@ -103,7 +103,8 @@ public enum ServerMeter implements AbstractMetrics.Meter {
   NUM_SEGMENTS_PRUNED_INVALID("numSegmentsPrunedInvalid", false),
   NUM_SEGMENTS_PRUNED_BY_LIMIT("numSegmentsPrunedByLimit", false),
   NUM_SEGMENTS_PRUNED_BY_VALUE("numSegmentsPrunedByValue", false),
-  LARGE_QUERY_RESPONSES_SENT("largeResponses", false);
+  LARGE_QUERY_RESPONSES_SENT("largeResponses", false),
+  TOTAL_THREAD_CPU_TIME_MILLIS("millis", false);
 
   private final String _meterName;
   private final String _unit;
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java
index f60962730a..a0d72a9a67 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java
@@ -227,6 +227,8 @@ public abstract class QueryScheduler {
       if (threadCpuTimeNs > 0) {
         _serverMetrics.addTimedTableValue(tableNameWithType, 
ServerTimer.EXECUTION_THREAD_CPU_TIME_NS, threadCpuTimeNs,
             TimeUnit.NANOSECONDS);
+        _serverMetrics.addMeteredTableValue(tableNameWithType, 
ServerMeter.TOTAL_THREAD_CPU_TIME_MILLIS,
+            TimeUnit.MILLISECONDS.convert(threadCpuTimeNs, 
TimeUnit.NANOSECONDS));
       }
       if (systemActivitiesCpuTimeNs > 0) {
         _serverMetrics.addTimedTableValue(tableNameWithType, 
ServerTimer.SYSTEM_ACTIVITIES_CPU_TIME_NS,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to