You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a demo of how to monitor containers with simple Docker commands.
4
+
5
+
## To run
6
+
7
+
**Pre-requisites:** You need to have Docker installed and running first. See [Docker's installation instructions](https://docs.docker.com/engine/installation/) for more information.
8
+
9
+
Once you've cloned this repo, run this to build the demo app:
10
+
11
+
```bash
12
+
docker build -t highcpu-go highcpu-go
13
+
14
+
docker run --rm --name highcpu-go -d highcpu-go
15
+
```
16
+
17
+
### Monitoring with docker stats
18
+
19
+
The app is designed to oscillate between using 100% CPU and 0% CPU.
20
+
21
+
You can see the container's CPU usage with `docker stats`. We'll run the command with a screen refresh interval of 1 second:
22
+
23
+
```bash
24
+
docker stats --interval 1
25
+
```
26
+
27
+
You should see something like this:
28
+
29
+
```bash
30
+
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU %
0 commit comments