Skip to content

Commit be32d82

Browse files
Change formatted of the table
1 parent 39fcbfc commit be32d82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compose/bin/docker-stats

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ INTERVAL=3
77
trap 'stty echo; exit' INT EXIT
88

99
print_header() {
10-
echo "+----------------------------------------------------+--------------+----------+-----------+----------------+"
11-
printf "| %-50s | %-12s | %-8s | %-8s | %-15s |\n" "NAME" "CONTAINER ID" "CPU %" "Memory %" "Memory Usage"
12-
echo "+----------------------------------------------------+--------------+----------+-----------+----------------+"
10+
echo "+----------------------------------------------------+--------------+----------+----------+----------------+"
11+
printf "| %-50s | %-12s | %-8s | %-8s | %-14s |\n" "NAME" "CONTAINER ID" "CPU %" "Memory %" "Memory Usage"
12+
echo "+----------------------------------------------------+--------------+----------+----------+----------------+"
1313
}
1414

1515
print_container_info() {
@@ -18,7 +18,7 @@ print_container_info() {
1818
local container_id=${container_info[1]}
1919
local container_stats=(${container_info[@]:2})
2020

21-
printf "| %-50s | %-12s | %-8s | %-8s | %-15s |\n" "$container_name" "$container_id" "${container_stats[0]}" "${container_stats[1]}" "${container_stats[2]}"
21+
printf "| %-50s | %-12s | %-8s | %-8s | %-14s |\n" "$container_name" "$container_id" "${container_stats[0]}" "${container_stats[1]}" "${container_stats[2]}"
2222
}
2323

2424
while true; do
@@ -33,7 +33,7 @@ while true; do
3333
print_container_info "$(echo "$line" | awk '{gsub(/\//, " "); print}')"
3434
done <<< "$DOCKER_STATS"
3535

36-
echo "+----------------------------------------------------+--------------+-----------+----------+----------------+"
36+
echo "+----------------------------------------------------+--------------+----------+----------+----------------+"
3737
else
3838
echo "No active containers found"
3939
break

0 commit comments

Comments
 (0)