azagrebin commented on a change in pull request #13316:
URL: https://github.com/apache/flink/pull/13316#discussion_r497474559



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java
##########
@@ -271,12 +271,28 @@ public int getTotalNumberOfMemorySegments() {
                return totalNumberOfMemorySegments;
        }
 
+       public long getTotalMemory() {
+               return getTotalNumberOfMemorySegments() * memorySegmentSize;
+       }
+
        public int getNumberOfAvailableMemorySegments() {
                synchronized (availableMemorySegments) {
                        return availableMemorySegments.size();
                }
        }
 
+       public long getAvailableMemory() {
+               return getNumberOfAvailableMemorySegments() * memorySegmentSize;
+       }
+
+       public int getNumberOfUsedMemorySegments() {
+               return getTotalNumberOfMemorySegments() - 
getNumberOfAvailableMemorySegments();
+       }
+
+       public long getUsedMemory() {
+               return getNumberOfUsedMemorySegments() * memorySegmentSize;
+       }

Review comment:
       Ok, I did not release that it is more sophisticated internally.
   One would need to understand then what the exact metric is in this case to 
calculate it.
   
   After offline discussion with @tillrohrmann, we decided to merge this PR to 
deliver the coarse grained metric.
   Later we can revisit this topic if this inaccuracy becomes a bigger 
problem/need for users.




----------------------------------------------------------------
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:
[email protected]


Reply via email to