Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch the script bin/docker-stats to the simplified output #1083

Merged

Conversation

YevhenZvieriev
Copy link
Contributor

@YevhenZvieriev YevhenZvieriev commented Mar 6, 2024

This script provides a simple way to monitor Docker container resource usage using the docker stats command. It continuously displays the CPU and memory usage of active Docker containers in a formatted table and fixes #1075 .

How it works:

Screenshot_2024-03-16_15-39-19

Copy link

what-the-diff bot commented Mar 6, 2024

PR Summary

  • Enhancements to the docker-stats script
    This PR involves updates to the internal functioning of the docker-stats script. These updates enable a refresh interval of 3 seconds.

  • Script enhancements for clean execution
    The script has also been improved for better handling of 'Interrupt' and 'Exit' signals. Now, whenever the script encounters these signals, it executes a command before stopping, ensuring a clean exit.

  • New functions for improved information display
    Two new functions, print_header and print_container_info, have been added to improve how information about the containers is displayed.

  • Automated container data collection and display
    The script is now automated to use the docker stats command to fetch data about the containers. It then formats this information and displays it in a table structure.

  • Implementation of data refresh cycle
    The script is now equipped with a loop function that continuously clears the terminal and refreshes the container information display at regular intervals.

@markshust
Copy link
Owner

Thanks -- looks good. I just updated the shebang as we use a more portable one within all of the other scripts. Merged in, appreciate it.

@markshust markshust merged commit b7b2cec into markshust:master Mar 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error response from daemon: page not found during executing bin/docker-stats script
2 participants