nizhikov commented on a change in pull request #6814: IGNITE-12108 TCP Communication Metrics ported to a new framework. URL: https://github.com/apache/ignite/pull/6814#discussion_r324684423
########## File path: modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java ########## @@ -2860,14 +2895,17 @@ final void reset0() { * Gets outbound messages queue size. * * @return Write queue size. + * @deprecated Will be removed in the next major release and replaced with new metrics API. */ + @Deprecated public int outboundMessagesQueueSize() { - int res = 0; - - for (GridSelectorNioSessionImpl ses : sessions) - res += ses.writeQueueSize(); + if (mreg == null) + return -1; - return res; + return (int) mreg.longAdderMetric( Review comment: It's about unnecessary `Map#get` operation. Every 'mreg.longAdderMetric` translates to `Map#get`. Why do we need it? We can store the variable, isn't it? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services