Skip to content

Commit 1a13f21

Browse files
authored
add network stats (#40)
1 parent aed5e9d commit 1a13f21

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

shared/uk-check-stats.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ fi
2323
# get instance stats in a loop until ctrl-c
2424
trap 'echo "Stopping stats collection..."; exit 0' INT
2525

26-
echo -e "RSS\tCPU Time\tTX Bytes"
26+
echo -e "RSS\tCPU Time\tTX Bytes\tNConns\tNReqs\tNQueued\tNTotal"
2727
while true; do
2828
metrics=$(curl -s -H "Authorization: Bearer $UKC_TOKEN" "$UKC_METRO/instances/$instance_id/metrics")
2929
rss=$(echo "$metrics" | grep 'instance_rss_bytes{instance_uuid=' | cut -d' ' -f2)
3030
cpu_time=$(echo "$metrics" | grep 'instance_cpu_time_s{instance_uuid=' | cut -d' ' -f2)
3131
tx_bytes=$(echo "$metrics" | grep 'instance_tx_bytes{instance_uuid=' | cut -d' ' -f2)
32-
echo -e "$rss\t$cpu_time\t$tx_bytes"
32+
nconns=$(echo "$metrics" | grep 'instance_nconns{instance_uuid=' | cut -d' ' -f2)
33+
nreqs=$(echo "$metrics" | grep 'instance_nreqs{instance_uuid=' | cut -d' ' -f2)
34+
nqueued=$(echo "$metrics" | grep 'instance_nqueued{instance_uuid=' | cut -d' ' -f2)
35+
ntotal=$(echo "$metrics" | grep 'instance_ntotal{instance_uuid=' | cut -d' ' -f2)
36+
echo -e "$rss\t$cpu_time\t$tx_bytes\t$nconns\t$nreqs\t$nqueued\t$ntotal"
3337
sleep 1
3438
done

0 commit comments

Comments
 (0)