MeihanLi commented on code in PR #12340:
URL: https://github.com/apache/pinot/pull/12340#discussion_r1496431994


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java:
##########
@@ -377,4 +389,15 @@ public Double fetchHybridScoreForServer(String server) {
       stats.getServerReadLock().unlock();
     }
   }
+
+  private void recordQueueSizeMetrics() {
+    int queueSize = getQueueSize();
+    
_brokerMetrics.setValueOfGlobalGauge(BrokerGauge.ROUTING_STATS_MANAGER_QUEUE_SIZE,
 queueSize);
+    if (queueSize > _executorQueueSizeWarnThreshold) {
+      
_brokerMetrics.addMeteredGlobalValue(BrokerMeter.ROUTING_STATS_MANAGER_Q_LIMIT_REACHED,
 1L);
+      LOGGER.warn(String.format("Stats Manager queue size exceeds warn 
threshold = %d. "
+              + "Current queue size = %d, completed task count = %d.",
+          _executorQueueSizeWarnThreshold, queueSize, 
getCompletedTaskCount()));

Review Comment:
   It could. For high qps, we can increase the warn threshold as needed or 
disable the logging if it can cause issues. 
   
   This diff mainly focus on having the visibility on stats updates. 



##########
pinot-core/src/main/java/org/apache/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java:
##########
@@ -377,4 +389,15 @@ public Double fetchHybridScoreForServer(String server) {
       stats.getServerReadLock().unlock();
     }
   }
+
+  private void recordQueueSizeMetrics() {
+    int queueSize = getQueueSize();
+    
_brokerMetrics.setValueOfGlobalGauge(BrokerGauge.ROUTING_STATS_MANAGER_QUEUE_SIZE,
 queueSize);
+    if (queueSize > _executorQueueSizeWarnThreshold) {
+      
_brokerMetrics.addMeteredGlobalValue(BrokerMeter.ROUTING_STATS_MANAGER_Q_LIMIT_REACHED,
 1L);
+      LOGGER.warn(String.format("Stats Manager queue size exceeds warn 
threshold = %d. "
+              + "Current queue size = %d, completed task count = %d.",
+          _executorQueueSizeWarnThreshold, queueSize, 
getCompletedTaskCount()));

Review Comment:
   It could. For high qps, we can increase the warn threshold as needed or 
disable the logging if it can cause issues. 
   
   This diff mainly focuses on having the visibility on stats updates. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to