gortiz commented on PR #11575:
URL: https://github.com/apache/pinot/pull/11575#issuecomment-1729055236

   > It looks like the "periodic" update is now done when channel is 
initialized ? If so, that is not enough imo to see the trend line and may give 
an outdated picture ?
   
   There is either something I'm missing or something you are :D.
   
   Where do you say the metric is only updated once when channel is 
initialized? In 
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java and 
pinot-core/src/main/java/org/apache/pinot/core/transport/ServerChannels.java 
I'm using the method that sets a Supplier, not the actual value. I'm mainly 
calling `AbstractMetrics.setOrUpdateGlobalGauge(final String metricName, final 
LongSupplier valueSupplier)`.
   
   When using this method that accepts a supplier, it is stored in the metric. 
Whenever the metric is read (from JMX) it calls the supplier. Therefore the 
value is calculated at pulling base, not pushing base. That is why we don't 
need to `set` periodically.
   
   There are other places where we use this family of methods, like:
   - 
https://github.com/apache/pinot/blob/bc07eb8e7fa1ea4ef26ebbcd1a2ce2087a3058e4/pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java#L864
   - 
https://github.com/apache/pinot/blob/bc07eb8e7fa1ea4ef26ebbcd1a2ce2087a3058e4/pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java#L864
   
   But maybe what do you mean is that in some place in this PR I'm not calling 
the version with the supplier and therefore the value never change. If read the 
PR again looking for that but it looks to me that I'm always using the supplier 
(using the notation `metric::method`).


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