kl0u commented on issue #7850: [FLINK-11183][metrics] Properly measure current memory usage URL: https://github.com/apache/flink/pull/7850#issuecomment-468669405 Or, we could even extract as separate methods the: ``` MetricGroup heap = metrics.addGroup("Heap"); heap.<Long, Gauge<Long>>gauge("Used", () -> memoryBean.getHeapMemoryUsage().getUsed()); heap.<Long, Gauge<Long>>gauge("Committed", () -> memoryBean.getHeapMemoryUsage().getCommitted()); heap.<Long, Gauge<Long>>gauge("Max", () -> memoryBean.getHeapMemoryUsage().getMax()); ``` and the same lines for the `off-heap` memory, with descriptive names, and test those methods separately. This will also help at enforcing the "each method should have a single responsibility" principle. What do you think @zentol ?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
