spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

Render memory values in a human-readable format

Open cdprete opened this issue 2 months ago • 0 comments

Hello.

Enhancement It would be great if the heap and non-heap memory values returned by the ProcessInfoContributor would be rendered in a human-readable format. For example: 1MB instead of 1048576. I'm referring to the values in red below:

Image

Of course, when -1 is returned then it stays like it is.

Please make sure to validate the format of the response returned by such info contributor before trying to decorate it. I say this because, for non-Java applications, I've actually developed an agent-like application instead that monitors the native process (that's how I realised that the sorting is broken in https://github.com/codecentric/spring-boot-admin/issues/4341) and for the same contributor returns a response like:

Image

Of course, I don't expect my custom format to be supported. ~~Unless, as a possibility, you may try to render as human-readable every integral value that gets returned under (reaching the leafs of the tree object) the memory entry. This would cover both the use cases transparently but, I can easily imagine, it requires more effort from your side.~~ Ignore the statement above. The garbageCollectors entry is also under memory and it shouldn't be touched, so that's not as easy as anticipated.

cdprete avatar Nov 21 '25 06:11 cdprete