You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2024/04/25 23:15:49 UTC

(pinot) branch master updated: Add some multi-stage metrics (#12982)

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

jackie 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 2fb30c0c0f Add some multi-stage metrics (#12982)
2fb30c0c0f is described below

commit 2fb30c0c0f74b3a7108f2a5749b1b332156b4fc3
Author: Gonzalo Ortiz Jaureguizar <go...@users.noreply.github.com>
AuthorDate: Fri Apr 26 01:15:42 2024 +0200

    Add some multi-stage metrics (#12982)
---
 .../MultiStageBrokerRequestHandler.java               |  6 ++++++
 .../org/apache/pinot/common/metrics/BrokerMeter.java  | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
index 01e4884d6a..01bfe456b5 100644
--- a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
+++ b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
@@ -170,6 +170,12 @@ public class MultiStageBrokerRequestHandler extends BaseBrokerRequestHandler {
 
     DispatchableSubPlan dispatchableSubPlan = queryPlanResult.getQueryPlan();
     Set<String> tableNames = queryPlanResult.getTableNames();
+
+    _brokerMetrics.addMeteredGlobalValue(BrokerMeter.MULTI_STAGE_QUERIES_GLOBAL, 1);
+    for (String tableName : tableNames) {
+      _brokerMetrics.addMeteredTableValue(tableName, BrokerMeter.MULTI_STAGE_QUERIES, 1);
+    }
+
     requestContext.setTableNames(List.copyOf(tableNames));
 
     // Compilation Time. This includes the time taken for parsing, compiling, create stage plans and assigning workers.
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerMeter.java b/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerMeter.java
index bb76591ab0..006ee458eb 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerMeter.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerMeter.java
@@ -29,7 +29,26 @@ public enum BrokerMeter implements AbstractMetrics.Meter {
   UNCAUGHT_POST_EXCEPTIONS("exceptions", true),
   HEALTHCHECK_BAD_CALLS("healthcheck", true),
   HEALTHCHECK_OK_CALLS("healthcheck", true),
+  /**
+   * Number of queries executed.
+   * <p>
+   * At this moment this counter does not include queries executed in multi-stage mode.
+   */
   QUERIES("queries", false),
+  /**
+   * Number of multi-stage queries that have been started.
+   * <p>
+   * Unlike {@link #MULTI_STAGE_QUERIES}, this metric is global and not attached to a particular table.
+   * That means it can be used to know how many multi-stage queries have been started in total.
+   */
+  MULTI_STAGE_QUERIES_GLOBAL("queries", true),
+  /**
+   * Number of multi-stage queries that have been started touched a given table.
+   * <p>
+   * In case the query touch multiple tables (ie using joins)1, this metric will be incremented for each table, so the
+   * sum of this metric across all tables should be greater or equal than {@link #MULTI_STAGE_QUERIES_GLOBAL}.
+   */
+  MULTI_STAGE_QUERIES("queries", false),
 
   // These metrics track the exceptions caught during query execution in broker side.
   // Query rejected by Jersey thread pool executor


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org