#!/bin/bash


conection(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | grep -i "active" |awk '{print $NF}'
}

server(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk -F" " 'NR==3{print $1}'
}

accepts(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk -F" " 'NR==3{print $2}'
}

handled_requests(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk -F" " 'NR==3{print $3}'
}

reading(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk NR==4 | awk '{print $2}'
}

writing(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk NR==4 | awk '{print $4}'
}

waiting(){
  curl http://127.0.0.1:17777/ngx_status 2>/dev/null | awk NR==4 | awk '{print $6}'
}

$1
