parse values as number
This commit is contained in:
parent
6358e2dac4
commit
21e234b1c7
|
@ -83,13 +83,13 @@ location /nginx/stats {
|
||||||
local json = require('cjson')
|
local json = require('cjson')
|
||||||
ngx.say(json.encode{
|
ngx.say(json.encode{
|
||||||
-- current number of active client connections including waiting connections
|
-- current number of active client connections including waiting connections
|
||||||
connections_active = ngx.var.connections_active,
|
connections_active = tonumber(ngx.var.connections_active),
|
||||||
-- current number of connections where nginx is reading the request header
|
-- current number of connections where nginx is reading the request header
|
||||||
connections_reading = ngx.var.connections_reading,
|
connections_reading = tonumber(ngx.var.connections_reading),
|
||||||
-- current number of connections where nginx is writing the response back to the client
|
-- current number of connections where nginx is writing the response back to the client
|
||||||
connections_writing = ngx.var.connections_writing,
|
connections_writing = tonumber(ngx.var.connections_writing),
|
||||||
-- current number of idle client connections waiting for a request
|
-- current number of idle client connections waiting for a request
|
||||||
connections_waiting = ngx.var.connections_waiting,
|
connections_waiting = tonumber(ngx.var.connections_waiting),
|
||||||
})
|
})
|
||||||
return ngx.exit(ngx.HTTP_OK)
|
return ngx.exit(ngx.HTTP_OK)
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue