Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit f6ebeb7

Browse files
committed
fixing #363
1 parent af2f8f6 commit f6ebeb7

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

developer-tools/java/chapters/ch10-monitoring.adoc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,25 @@ to see the output:
5353
+
5454
```
5555
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
56-
55198043b6aa 0.12% 267.3MiB / 1.952GiB 13.38% 782B / 0B 0B / 4.1kB 53
57-
5b5dd33b675d 0.11% 274.2MiB / 1.952GiB 13.72% 782B / 0B 0B / 4.1kB 53
58-
6e98a9597e6a 0.10% 273.2MiB / 1.952GiB 13.67% 1.03kB / 0B 0B / 4.1kB 51
56+
1f9d5a1c08a8 0.24% 294.9MiB / 1.952GiB 14.75% 828B / 0B 96.5MB / 4.1kB 115
5957
```
6058
+
61-
Note that the container id is shown in this case instead of container's name.
59+
Note that the container id is shown instead of container's name in this case.
60+
+
61+
. Scale the service to 3 replicas:
62+
+
63+
```
64+
docker service scale web=3
65+
```
66+
+
67+
. The stats are now shown for all three containers:
68+
+
69+
```
70+
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
71+
1f9d5a1c08a8 0.14% 287.8MiB / 1.952GiB 14.40% 1.03kB / 0B 96.5MB / 4.1kB 53
72+
a3395efbb6ff 0.77% 263.4MiB / 1.952GiB 13.18% 578B / 0B 0B / 4.1kB 114
73+
f484ff2f4c12 0.06% 294.8MiB / 1.952GiB 14.75% 578B / 0B 0B / 4.1kB 114
74+
```
6275
+
6376
. Display only container id and percent CPU utilization using the command `docker container stats --format "{{.Container}}: {{.CPUPerc}}"`:
6477
+

0 commit comments

Comments
 (0)