Skip to content

Commit

Permalink
Fix get_memory.sh examples on README
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs authored Jun 9, 2024
1 parent cb59a5e commit ae46797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@ In a system with cgroup v2:

```console
cat get_memory.sh | docker run --rm -i -e VERBOSE=true alpine sh
VERBOSE(get_cpus.sh): cgroup v2 detected.
VERBOSE(get_cpus.sh): No memory limits set.
VERBOSE(get_cpus.sh): Memory (MB):
VERBOSE(get_memory.sh): cgroup v2 detected.
VERBOSE(get_memory.sh): No memory limits set.
VERBOSE(get_memory.sh): Memory (MB):
15996

cat get_memory.sh | docker run --rm -i -e VERBOSE=true --memory 1g alpine sh
VERBOSE(get_cpus.sh): cgroup v2 detected.
VERBOSE(get_cpus.sh): Memory (MB):
VERBOSE(get_memory.sh): cgroup v2 detected.
VERBOSE(get_memory.sh): Memory (MB):
1024
```

Another system with cgroup v1:

```console
cat get_memory.sh | docker run --rm -i -e VERBOSE=true alpine sh
VERBOSE(get_cpus.sh): cgroup v1 detected.
VERBOSE(get_cpus.sh): No memory limits set.
VERBOSE(get_memory.sh): cgroup v1 detected.
VERBOSE(get_memory.sh): No memory limits set.
Memory (MB):
32092

cat get_memory.sh | docker run --rm -i -e VERBOSE=true --memory 1g alpine sh
VERBOSE(get_cpus.sh): cgroup v1 detected.
VERBOSE(get_cpus.sh): Memory (MB):
VERBOSE(get_memory.sh): cgroup v1 detected.
VERBOSE(get_memory.sh): Memory (MB):
1024
```
2 changes: 1 addition & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function expect() {

"${docker_cmd[@]}" --cpus 2 alpine ./get_cpus.sh | expect 2

"${docker_cmd[@]}" --cpus 0.5 alpine ./get_cpus.sh | expect 1
"${docker_cmd[@]}" --cpus 0.5 ubuntu ./get_cpus.sh | expect 1

"${docker_cmd[@]}" --cpus 1.5 alpine ./get_cpus.sh | expect 1

Expand Down

0 comments on commit ae46797

Please sign in to comment.