Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf/metrics #3634

Merged
merged 3 commits into from
Apr 22, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Do not recalculate make_host_type_name if global names are configured
  • Loading branch information
NelsonVides committed Apr 22, 2022
commit 96851f531c42c0dcff220690201f3614bf4543b4
8 changes: 7 additions & 1 deletion src/metrics/mongoose_metrics.erl
Original file line number Diff line number Diff line change
@@ -195,6 +195,12 @@ remove_all_metrics() ->
all_metrics_are_global() ->
mongoose_config:get_opt(all_metrics_are_global).

pick_prefix_by_all_metrics_are_global(HostType) ->
case all_metrics_are_global() of
true -> global;
false -> make_host_type_name(HostType)
end.

pick_by_all_metrics_are_global(WhenGlobal, WhenNot) ->
case all_metrics_are_global() of
true -> WhenGlobal;
@@ -204,7 +210,7 @@ pick_by_all_metrics_are_global(WhenGlobal, WhenNot) ->
-spec name_by_all_metrics_are_global(HostType :: mongooseim:host_type_or_global(),
Name :: list()) -> FinalName :: list().
name_by_all_metrics_are_global(HostType, Name) ->
pick_by_all_metrics_are_global([global | Name], [make_host_type_name(HostType) | Name]).
[pick_prefix_by_all_metrics_are_global(HostType) | Name].

get_report_interval() ->
application:get_env(exometer_core, mongooseim_report_interval,