Cache calls don't need to go through worker pool
This commit is contained in:
parent
e4ec999783
commit
98199b3c53
|
|
@ -156,7 +156,7 @@ augment_queues(Qs, ?NO_RANGES = Ranges, basic) ->
|
||||||
submit_cached(queues,
|
submit_cached(queues,
|
||||||
fun(Interval) ->
|
fun(Interval) ->
|
||||||
list_queue_stats(Ranges, Qs, Interval)
|
list_queue_stats(Ranges, Qs, Interval)
|
||||||
end, length(Qs)); %% TODO: wait 1ms per queue - review
|
end, max(5000, length(Qs))); %% TODO: wait 1ms per queue - review
|
||||||
augment_queues(Qs, Ranges, basic) ->
|
augment_queues(Qs, Ranges, basic) ->
|
||||||
submit(fun(Interval) -> list_queue_stats(Ranges, Qs, Interval) end);
|
submit(fun(Interval) -> list_queue_stats(Ranges, Qs, Interval) end);
|
||||||
augment_queues(Qs, Ranges, _) ->
|
augment_queues(Qs, Ranges, _) ->
|
||||||
|
|
@ -212,12 +212,7 @@ submit(Fun) ->
|
||||||
|
|
||||||
submit_cached(Key, Fun, Timeout) ->
|
submit_cached(Key, Fun, Timeout) ->
|
||||||
{ok, Interval} = application:get_env(rabbit, collect_statistics_interval),
|
{ok, Interval} = application:get_env(rabbit, collect_statistics_interval),
|
||||||
{ok, Res} = rabbit_mgmt_db_cache:fetch(Key,
|
{ok, Res} = rabbit_mgmt_db_cache:fetch(Key, fun() -> Fun(Interval) end, Timeout),
|
||||||
fun() ->
|
|
||||||
worker_pool:submit(management_worker_pool,
|
|
||||||
fun() -> Fun(Interval) end,
|
|
||||||
reuse)
|
|
||||||
end, Timeout),
|
|
||||||
Res.
|
Res.
|
||||||
|
|
||||||
%%----------------------------------------------------------------------------
|
%%----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,6 @@ queue(Config) ->
|
||||||
basic_get(Chan2, <<"some-queue">>),
|
basic_get(Chan2, <<"some-queue">>),
|
||||||
force_stats(),
|
force_stats(),
|
||||||
timer:sleep(10000),
|
timer:sleep(10000),
|
||||||
dump_table(Config, channel_queue_metrics),
|
|
||||||
Res = http_get(Config, "/queues/%2f/some-queue"),
|
Res = http_get(Config, "/queues/%2f/some-queue"),
|
||||||
rabbit_ct_client_helpers:close_connection(Conn),
|
rabbit_ct_client_helpers:close_connection(Conn),
|
||||||
http_delete(Config, "/queues/%2f/some-queue", ?NO_CONTENT),
|
http_delete(Config, "/queues/%2f/some-queue", ?NO_CONTENT),
|
||||||
|
|
@ -326,9 +325,6 @@ queue(Config) ->
|
||||||
|
|
||||||
queues_single(Config) ->
|
queues_single(Config) ->
|
||||||
http_put(Config, "/queues/%2f/some-queue", [], ?CREATED),
|
http_put(Config, "/queues/%2f/some-queue", [], ?CREATED),
|
||||||
trace_fun(Config, [{delegate, invoke},
|
|
||||||
{rabbit_mgmt_db, cached_delegate_invoke},
|
|
||||||
{rabbit_mgmt_db, cache_lookup}]),
|
|
||||||
force_stats(),
|
force_stats(),
|
||||||
Res = http_get(Config, "/queues/%2f"),
|
Res = http_get(Config, "/queues/%2f"),
|
||||||
_Res = http_get(Config, "/queues/%2f"),
|
_Res = http_get(Config, "/queues/%2f"),
|
||||||
|
|
@ -343,7 +339,6 @@ queues_multiple(Config) ->
|
||||||
http_put(Config, "/queues/%2f/some-queue", [], ?CREATED),
|
http_put(Config, "/queues/%2f/some-queue", [], ?CREATED),
|
||||||
http_put(Config, "/queues/%2f/some-other-queue", QArgs, ?CREATED),
|
http_put(Config, "/queues/%2f/some-other-queue", QArgs, ?CREATED),
|
||||||
|
|
||||||
trace_fun(Config, [{rabbit_mgmt_db, submit_cached}]),
|
|
||||||
force_stats(),
|
force_stats(),
|
||||||
Res = http_get(Config, "/queues/%2f"),
|
Res = http_get(Config, "/queues/%2f"),
|
||||||
% assert some basic data is present
|
% assert some basic data is present
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue