mum4k / termdash

Terminal based dashboard.
Apache License 2.0
2.72k stars 136 forks source link

Implements a buffer limit for the Text widget #294

Closed timbutler closed 3 years ago

timbutler commented 3 years ago

See issue #293 where memory and performance can degrade with a high number of lines written to the Text widget.

This is a very simplistic implementation to limit the possible length the text buffer can grow to with the maxContent option.

Default value of -1 means there's no limit and therefore behaviour should remain standard.

It has been working in our test app and allows the use of the Text widget to monitor logs (ie tail) and therefore doesn't bloat over time, but happy to adjust as required.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 2144


Changes Missing Coverage Covered Lines Changed/Added Lines %
widgets/text/text.go 5 13 38.46%
<!-- Total: 10 18 55.56% -->
Totals Coverage Status
Change from base Build 2093: -0.07%
Covered Lines: 8395
Relevant Lines: 9204

💛 - Coveralls
mum4k commented 3 years ago

Thank you very much @timbutler, I will be happy to merge as is and work on the remaining items.

Before we do that I have one more CLA related favor to ask for. Can you please explicitly state that you give me permission to merge this code into the master branch? This is required to pass the CLA check when I will be releasing the commits authored by you.

timbutler commented 3 years ago

Hi @mum4k, sorry for the delay. I'm happy for all of my code to be merged into the master branch.

mum4k commented 3 years ago

Thank you again for the confirmation and the contribution @timbutler.