docker / cli

The Docker CLI
Apache License 2.0
4.97k stars 1.94k forks source link

[27.x backport] Optimise `docker stats` to not require clearing the whole screen #5635

Closed thaJeztah closed 1 week ago

thaJeztah commented 1 week ago

Instead of clearing the whole screen and then writing the new stats, we now write the new stats on top of the old text, and then clear the remaining text.

This is a more efficient way to update the stats, as it avoids the flickering that happens when the screen is cleared and rewritten.

(cherry picked from commit cb2f95ceee76c7166e95ec1b59c3e2fbac9b0079)

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

thaJeztah commented 1 week ago

@laurazard @vvoland backporting this one as this is a follow-up to https://github.com/docker/cli/pull/5586, which was backported (https://github.com/docker/cli/pull/5588)

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 58.54%. Comparing base (877668c) to head (39d73af). Report is 3 commits behind head on 27.x.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 27.x #5635 +/- ## ========================================== - Coverage 58.55% 58.54% -0.02% ========================================== Files 346 346 Lines 29329 29335 +6 ========================================== Hits 17173 17173 - Misses 11178 11184 +6 Partials 978 978 ```

🚨 Try these New Features: