-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(timerng) integrate the lua-resty-timer-ng (#8912)
* fix(plugin_servers) bypass timer library * feat(AdminAPI) add `/timer` route * feat(conf) add new config `legacy_timer_mechanism` (boolean) * chore(rockspec) add `resty.timerng` as dependency * tests(*) add `wait_timers_*()` for helper * tests(plugin/zipkin) fix * tests(unit/db/cache_warmup) fix * tests(integration/cmd/quit) fix * tests(integration/hybrid_mode/ocsp) fix * tests(plugin/rate-limiting/access) fix * tests(integration/db/query-semaphore) fix * tests(integration/admin/timers) add tests for `http://kong_admin/timers` * tests(integration/cmd/start_stop) fix * tests(integration/proxy/router) fix * docs(CHANGELOG) update Co-authored-by: Mayo <[email protected]> Co-authored-by: Wangchong Zhou <[email protected]>
- Loading branch information
1 parent
73f6868
commit 6780491
Showing
18 changed files
with
360 additions
and
47 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
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
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
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
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,54 @@ | ||
local helpers = require "spec.helpers" | ||
local cjson = require "cjson" | ||
|
||
|
||
for _, strategy in helpers.each_strategy() do | ||
|
||
describe("Admin API[#" .. strategy .. "]" , function() | ||
local client | ||
|
||
lazy_setup(function() | ||
helpers.get_db_utils(strategy) | ||
|
||
assert(helpers.start_kong({ | ||
database = strategy, | ||
nginx_conf = "spec/fixtures/custom_nginx.template", | ||
})) | ||
|
||
client = helpers.admin_client() | ||
end) | ||
|
||
teardown(function() | ||
if client then | ||
client:close() | ||
end | ||
helpers.stop_kong() | ||
end) | ||
|
||
it("/timers", function () | ||
local res = assert(client:send { | ||
method = "GET", | ||
path = "/timers", | ||
headers = { ["Content-Type"] = "application/json" } | ||
}) | ||
|
||
local body = assert.res_status(200 , res) | ||
local json = cjson.decode(body) | ||
|
||
assert(type(json.flamegraph.running) == "string") | ||
assert(type(json.flamegraph.pending) == "string") | ||
assert(type(json.flamegraph.elapsed_time) == "string") | ||
|
||
assert(type(json.sys.total) == "number") | ||
assert(type(json.sys.runs) == "number") | ||
assert(type(json.sys.running) == "number") | ||
assert(type(json.sys.pending) == "number") | ||
assert(type(json.sys.waiting) == "number") | ||
|
||
assert(type(json.timers) == "table") | ||
|
||
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
Oops, something went wrong.