Skip to content

Commit 2dfcd75

Browse files
authored
Merge pull request #1017 from YevhenZvieriev/feature/container-monitor
2 parents 0f1517e + 82ffbaf commit 2dfcd75

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ It is recommended to keep your root docker config files in one repository, and y
285285
- `bin/download`: Download specific Magento version from Composer to the container, with optional arguments of the version (2.4.6-p3 [default]) and type ("community" [default], "enterprise", or "mageos"). Ex. `bin/download 2.4.6-p3 enterprise`
286286
- `bin/debug-cli`: Enable Xdebug for bin/magento, with an optional argument of the IDE key. Defaults to PHPSTORM Ex. `bin/debug-cli enable PHPSTORM`
287287
- `bin/deploy`: Runs the standard Magento deployment process commands. Pass extra locales besides `en_US` via an optional argument. Ex. `bin/deploy nl_NL`
288+
- `bin/docker-stats`: Display status for CPU, memory usage, and memory limit of currently-running Docker containers.
288289
- `bin/fixowns`: This will fix filesystem ownerships within the container.
289290
- `bin/fixperms`: This will fix filesystem permissions within the container.
290291
- `bin/grunt`: Run the grunt binary. Ex. `bin/grunt exec`

compose/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ help:
3131
@echo "$(call format,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
3232
@echo "$(call format,devconsole,'Alias for n98-magerun2 dev:console.')"
3333
@echo "$(call format,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
34+
@echo "$(call format,docker-stats,'Display status for CPU, memory usage, and memory limit of currently-running Docker containers.')"
3435
@echo "$(call format,download,'Download & extract specific Magento version to the src directory.')"
3536
@echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')"
3637
@echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')"

compose/bin/docker-stats

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
container_ids=$(bin/docker-compose ps -q)
4+
5+
if [ -z "$container_ids" ]; then
6+
echo "No active containers found"
7+
exit 1
8+
fi
9+
10+
docker stats "$container_ids"

0 commit comments

Comments
 (0)