File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2323# get instance stats in a loop until ctrl-c
2424trap ' 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 "
2727while 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
3438done
You can’t perform that action at this time.
0 commit comments