Cache calls don't need to go through worker pool

This commit is contained in:
kjnilsson 2016-10-06 15:34:56 +01:00
parent e4ec999783
commit 98199b3c53
2 changed files with 2 additions and 12 deletions

View File

@ -156,7 +156,7 @@ augment_queues(Qs, ?NO_RANGES = Ranges, basic) ->
submit_cached(queues,
fun(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) ->
submit(fun(Interval) -> list_queue_stats(Ranges, Qs, Interval) end);
augment_queues(Qs, Ranges, _) ->
@ -212,12 +212,7 @@ submit(Fun) ->
submit_cached(Key, Fun, Timeout) ->
{ok, Interval} = application:get_env(rabbit, collect_statistics_interval),
{ok, Res} = rabbit_mgmt_db_cache:fetch(Key,
fun() ->
worker_pool:submit(management_worker_pool,
fun() -> Fun(Interval) end,
reuse)
end, Timeout),
{ok, Res} = rabbit_mgmt_db_cache:fetch(Key, fun() -> Fun(Interval) end, Timeout),
Res.
%%----------------------------------------------------------------------------

View File

@ -316,7 +316,6 @@ queue(Config) ->
basic_get(Chan2, <<"some-queue">>),
force_stats(),
timer:sleep(10000),
dump_table(Config, channel_queue_metrics),
Res = http_get(Config, "/queues/%2f/some-queue"),
rabbit_ct_client_helpers:close_connection(Conn),
http_delete(Config, "/queues/%2f/some-queue", ?NO_CONTENT),
@ -326,9 +325,6 @@ queue(Config) ->
queues_single(Config) ->
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(),
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-other-queue", QArgs, ?CREATED),
trace_fun(Config, [{rabbit_mgmt_db, submit_cached}]),
force_stats(),
Res = http_get(Config, "/queues/%2f"),
% assert some basic data is present