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


##########
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:
   Good call. I think we should remove this log line. We have metrics already 
for this and stats manager queue size being high is not really a major issue.



##########
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);

Review Comment:
   I think emitting the warning metric is not needed. We already have a gauge. 
Users should set warning/critical alerts on their end. Though the gauge value 
will get overwritten frequently and we will only have 1 value per bucket, I 
think it should be good enough since this is only measuring the stats.



-- 
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