jasperjiaguo commented on code in PR #11575:
URL: https://github.com/apache/pinot/pull/11575#discussion_r1325063807


##########
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java:
##########
@@ -74,10 +80,12 @@ public QueryServer(int port, NettyConfig nettyConfig, 
ChannelHandler instanceReq
    * @param nettyConfig configurations for netty library
    * @param tlsConfig TLS/SSL config
    */
-  public QueryServer(int port, NettyConfig nettyConfig, TlsConfig tlsConfig, 
ChannelHandler instanceRequestHandler) {
+  public QueryServer(int port, NettyConfig nettyConfig, TlsConfig tlsConfig, 
ChannelHandler instanceRequestHandler,
+      ServerMetrics serverMetrics) {

Review Comment:
   We can use ServerMetrics.get() to get the metrics instead of wiring it in 
through the function signature.



##########
pinot-core/src/main/java/org/apache/pinot/core/transport/ServerChannels.java:
##########
@@ -151,7 +153,24 @@ private class ServerChannel {
 
     ServerChannel(ServerRoutingInstance serverRoutingInstance) {
       _serverRoutingInstance = serverRoutingInstance;
+      PooledByteBufAllocator bufAllocator = PooledByteBufAllocator.DEFAULT;
+      PooledByteBufAllocatorMetric metric = bufAllocator.metric();
+      
_brokerMetrics.setOrUpdateGauge(BrokerGauge.NETTY_POOLED_USED_DIRECT_MEMORY.getGaugeName(),
+          metric.usedDirectMemory());
+      
_brokerMetrics.setOrUpdateGauge(BrokerGauge.NETTY_POOLED_USED_HEAP_MEMORY.getGaugeName(),

Review Comment:
   (nit) this should work w/o `.getGaugeName()`



##########
pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java:
##########
@@ -46,6 +47,26 @@ public enum ServerGauge implements AbstractMetrics.Gauge {
   DEDUP_PRIMARY_KEYS_COUNT("dedupPrimaryKeysCount", false),
   CONSUMPTION_QUOTA_UTILIZATION("ratio", false),
   JVM_HEAP_USED_BYTES("bytes", true),
+  NETTY_POOLED_USED_DIRECT_MEMORY("bytes", true),
+  NETTY_POOLED_USED_HEAP_MEMORY("bytes", true),
+  NETTY_POOLED_ARENAS_DIRECT("arenas", true),
+  NETTY_POOLED_ARENAS_HEAP("arenas", true),

Review Comment:
   +1, we should periodically update. Either upon we send/receive some number 
of requests or use a timed task.



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