]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug/memstats: automatically determine first column size
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Aug 2022 06:51:08 +0000 (08:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Aug 2022 06:51:08 +0000 (08:51 +0200)
commit4a426e2082eb5620603e1a0a43afff5687a8cdb9
treeab5ad43ae7cfd53a89e7a96abe42e90cb3cb2c0f
parent17200dd1f33b4cd8236d43c6d93f31ca23875fc8
MINOR: debug/memstats: automatically determine first column size

The first column's width may vary a lot depending on outputs, and it's
annoying to have large empty columns on small names and mangled large
columns that are not yet large enough. In order to overcome this, this
patch adds a width field to the memstats applet's context, and this
width is calculated the first time the function is entered, by estimating
the width of all lines that will be dumped. This is simple enough and
does the job well. If in the future some filtering criteria are added,
it will still be possible to perform a single pass on everything
depending on the desired output format.
src/debug.c