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

Add container monitoring script #1017

Merged
merged 6 commits into from
Feb 24, 2024

Conversation

YevhenZvieriev
Copy link
Contributor

This Bash script provides a simple and clear display of Docker container statistics, including CPU usage and memory usage. The script utilizes the docker stats command and formats the output into a tabular format for easy readability.

Screenshot_2023-12-07_02-23-24

Copy link

what-the-diff bot commented Dec 7, 2023

PR Summary

  • Introduction of a Container Monitoring Script
    A new file named compose/bin/container-monitoring has been added. This file contains a shell script designed to keep track of container statistics. This improvement helps in understanding how the software runs within its container, specifically its usage of resources, thus enabling more effective system management and troubleshooting.

@rangerz
Copy link
Contributor

rangerz commented Dec 7, 2023

How about this way ? More concise I think.

#!/usr/bin/env bash
docker stats $(bin/docker-compose ps -q)
image

@YevhenZvieriev
Copy link
Contributor Author

YevhenZvieriev commented Dec 7, 2023

@rangerz Exactly!

I thought about that, but in my viewpoint, docker stats was giving too much information so I reduced it to just name, CPU usage, memory usage, and memory limit, but if this command does it in one line, why not?

I took that into account.
Please feel free to view my other scripts.

@markshust
Copy link
Owner

I really like the initial PR. I renamed it to bin/docker-stats though as that follows the naming convention of the underlying Docker command that we are running. Fixed the shellcheck error and added it to the readme.

@markshust markshust merged commit 2dfcd75 into markshust:master Feb 24, 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.

3 participants