File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ help() {
77 echo ' http://nginx.org/en/docs/http/ngx_http_stub_status_module.html'
88}
99
10- # Cummulative number of dropped connections
10+ # Cumulative number of dropped connections
1111unhandled () {
1212 local scraped=$( curl -s --fail localhost/nginx-health)
13- local accepts=$( echo ${scraped} | awk ' FNR == 3 {print $1}' )
14- local handled=$( echo ${scraped} | awk ' FNR == 3 {print $2}' )
13+ local accepts=$( echo " ${scraped} " | awk ' FNR == 3 {print $1}' )
14+ local handled=$( echo " ${scraped} " | awk ' FNR == 3 {print $2}' )
1515 echo $( expr ${accepts} - ${handled} )
1616}
1717
1818# ratio of connections-in-use to available workers
1919connections_load () {
2020 local scraped=$( curl -s --fail localhost/nginx-health)
21- local active=$( echo ${scraped} | awk ' /Active connections/{print $3}' )
22- local waiting=$( echo ${scraped} | awk ' /Reading/{print $6}' )
21+ local active=$( echo " ${scraped} " | awk ' /Active connections/{print $3}' )
22+ local waiting=$( echo " ${scraped} " | awk ' /Reading/{print $6}' )
2323 local workers=$( echo $( cat /etc/nginx/nginx.conf | perl -n -e' /worker_connections *(\d+)/ && print $1' )
2424)
2525 echo $( echo " scale=4; (${active} - ${waiting} ) / ${workers} " | bc)
You can’t perform that action at this time.
0 commit comments