Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deps/rabbit/src/rabbit_boot_steps.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ find_steps() ->
find_steps(loaded_applications()).

find_steps(Apps) ->
T0 = erlang:timestamp(),
T0 = erlang:monotonic_time(),
AttrsPerApp = rabbit_misc:rabbitmq_related_module_attributes(rabbit_boot_step),
T1 = erlang:timestamp(),
T1 = erlang:monotonic_time(),
?LOG_DEBUG(
"Boot steps: time to find boot steps: ~tp us",
[timer:now_diff(T1, T0)],
[erlang:convert_time_unit(T1 - T0, native, microsecond)],
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
All = sort_boot_steps(AttrsPerApp),
[Step || {App, _, _} = Step <- All, lists:member(App, Apps)].
Expand Down
6 changes: 3 additions & 3 deletions deps/rabbit/src/rabbit_deprecated_features.erl
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,12 @@ maybe_log_warning(FeatureName, Permitted) ->

should_log_warning(FeatureName) ->
Key = ?PT_DEPRECATION_WARNING_TS(FeatureName),
Now = erlang:timestamp(),
Now = erlang:monotonic_time(),
try
Last = persistent_term:get(Key),
Diff = timer:now_diff(Now, Last),
Diff = erlang:convert_time_unit(Now - Last, native, second),
if
Diff >= 24 * 60 * 60 * 1000 * 1000 ->
Diff >= 24 * 60 * 60 ->
persistent_term:put(Key, Now),
true;
true ->
Expand Down
6 changes: 3 additions & 3 deletions deps/rabbit/src/rabbit_feature_flags.erl
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ query_supported_feature_flags() ->
?LOG_DEBUG(
"Feature flags: query feature flags in loaded applications",
#{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}),
T0 = erlang:timestamp(),
T0 = erlang:monotonic_time(),
%% We need to know the list of applications we scanned for feature flags.
%% We can't derive that list of the returned feature flags because an
%% application might be loaded/present and not have a specific feature
Expand All @@ -842,11 +842,11 @@ query_supported_feature_flags() ->
rabbit_deprecated_feature, ScannedApps),
AttrsFromTestsuite = module_attributes_from_testsuite(),
TestsuiteProviders = [App || {App, _, _} <- AttrsFromTestsuite],
T1 = erlang:timestamp(),
T1 = erlang:monotonic_time(),
?LOG_DEBUG(
"Feature flags: time to find supported feature flags and deprecated "
"features: ~tp us",
[timer:now_diff(T1, T0)],
[erlang:convert_time_unit(T1 - T0, native, microsecond)],
#{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}),
AllAttributes = AttrsPerAppA ++ AttrsPerAppB ++ AttrsFromTestsuite,
AllApps = lists:usort(ScannedApps ++ TestsuiteProviders),
Expand Down
6 changes: 3 additions & 3 deletions deps/rabbit/src/rabbit_ff_registry_factory.erl
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,16 @@ maybe_initialize_registry(NewSupportedFeatureFlags,
"Feature flags: (re)initialize registry (~tp)",
[self()],
#{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}),
T0 = erlang:timestamp(),
T0 = erlang:monotonic_time(),
Ret = do_initialize_registry(RegistryVsn,
AllFeatureFlags,
FeatureStates,
Inventory,
WrittenToDisk),
T1 = erlang:timestamp(),
T1 = erlang:monotonic_time(),
?LOG_DEBUG(
"Feature flags: time to regen registry: ~tp us",
[timer:now_diff(T1, T0)],
[erlang:convert_time_unit(T1 - T0, native, microsecond)],
#{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}),
Ret;
false ->
Expand Down
13 changes: 7 additions & 6 deletions deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl
Original file line number Diff line number Diff line change
Expand Up @@ -878,21 +878,22 @@ cluster_nodes1(_, _, _, []) ->
ok.

handle_nodes_in_parallel(NodeConfigs, Fun) ->
T0 = erlang:timestamp(),
T0 = erlang:monotonic_time(),
Parent = self(),
Procs = [
begin
timer:sleep(rand:uniform(1000)),
spawn_link(fun() ->
T1 = erlang:timestamp(),
T1 = erlang:monotonic_time(),
Ret = Fun(NodeConfig),
T2 = erlang:timestamp(),
T2 = erlang:monotonic_time(),
ct:pal(
?LOW_IMPORTANCE,
"Time to run ~tp for node ~ts: ~b us",
[Fun,
?config(nodename, NodeConfig),
timer:now_diff(T2, T1)]),
erlang:convert_time_unit(
T2 - T1, native, microsecond)]),
Parent ! {parallel_handling_ret,
self(),
NodeConfig,
Expand All @@ -903,11 +904,11 @@ handle_nodes_in_parallel(NodeConfigs, Fun) ->
wait_for_node_handling(Procs, Fun, T0, []).

wait_for_node_handling([], Fun, T0, Results) ->
T3 = erlang:timestamp(),
T3 = erlang:monotonic_time(),
ct:pal(
?LOW_IMPORTANCE,
"Time to run ~tp for all nodes: ~b us",
[Fun, timer:now_diff(T3, T0)]),
[Fun, erlang:convert_time_unit(T3 - T0, native, microsecond)]),
Results;
wait_for_node_handling(Procs, Fun, T0, Results) ->
receive
Expand Down