-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Currie
committed
Nov 28, 2016
1 parent
0a2ce9c
commit f5dcf2f
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
# cpu-usage | ||
Retrieve container CPU usage stats | ||
# Docker CPU Usage Stats | ||
|
||
This project builds a simple static golang binary and corresponding Docker image that queries the Docker socket to retrieve the list of running containers and, for each, outputs the total CPU usage and elapsed time since the container was started. | ||
|
||
The Docker image can be run as follows: | ||
```bash | ||
docker run -v /var/run/docker.sock:/var/run/docker.sock --rm dcurrie/cpu-usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' . |