Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): enable status api by default
- Loading branch information
1 parent
b7a8361
commit ae99c6d
Showing
6 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
message: Enable `status_listen` on `127.0.0.1:8007` by default | ||
type: feature | ||
scope: Admin API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
local helpers = require "spec.helpers" | ||
local cjson = require "cjson" | ||
|
||
for _, strategy in helpers.all_strategies() do | ||
describe("Status API - with strategy #" .. strategy, function() | ||
it("default enable", function() | ||
assert.truthy(helpers.kong_exec("start -c spec/fixtures/default_status_listen.conf")) | ||
local client = helpers.http_client("127.0.0.1", 8007, 20000) | ||
finally(function() | ||
helpers.stop_kong() | ||
client:close() | ||
end) | ||
|
||
local res = assert(client:send { | ||
method = "GET", | ||
path = "/status", | ||
}) | ||
|
||
local body = assert.res_status(200, res) | ||
local json = cjson.decode(body) | ||
assert.is_table(json.server) | ||
|
||
assert.is_number(json.server.connections_accepted) | ||
assert.is_number(json.server.connections_active) | ||
assert.is_number(json.server.connections_handled) | ||
assert.is_number(json.server.connections_reading) | ||
assert.is_number(json.server.connections_writing) | ||
assert.is_number(json.server.connections_waiting) | ||
assert.is_number(json.server.total_requests) | ||
end) | ||
end) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 1st digit is 9 for our test instances | ||
admin_listen = 127.0.0.1:9001 | ||
proxy_listen = 0.0.0.0:9000, 0.0.0.0:9443 ssl | ||
|
||
ssl_cert = spec/fixtures/kong_spec.crt | ||
ssl_cert_key = spec/fixtures/kong_spec.key | ||
|
||
admin_ssl_cert = spec/fixtures/kong_spec.crt | ||
admin_ssl_cert_key = spec/fixtures/kong_spec.key | ||
|
||
database = postgres | ||
pg_host = 127.0.0.1 | ||
pg_port = 5432 | ||
pg_timeout = 10000 | ||
pg_database = kong_tests | ||
anonymous_reports = off | ||
|
||
dns_hostsfile = spec/fixtures/hosts | ||
|
||
nginx_main_worker_processes = 1 | ||
nginx_main_worker_rlimit_nofile = NONE | ||
nginx_events_worker_connections = NONE | ||
nginx_events_multi_accept = off | ||
|
||
prefix = servroot | ||
log_level = debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters