We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8f2bf66 + fdf98fd commit c09f1a8Copy full SHA for c09f1a8
src/mongoose_metrics.erl
@@ -174,7 +174,9 @@ pick_by_all_metrics_are_global(WhenGlobal, WhenNot) ->
174
175
-spec name_by_all_metrics_are_global(Host :: jid:lserver() | global,
176
Name :: list()) -> FinalName :: list().
177
-name_by_all_metrics_are_global(Host, Name) ->
+name_by_all_metrics_are_global(global, Name) -> [global | Name];
178
+name_by_all_metrics_are_global(Host0, Name) ->
179
+ Host = binary:replace(Host0, <<$.>>, <<$_>>, [global]),
180
pick_by_all_metrics_are_global([global | Name], [Host | Name]).
181
182
get_report_interval() ->
test/mongooseim_metrics_SUITE.erl
@@ -18,7 +18,7 @@ all() ->
18
19
groups() ->
20
[
21
- {ordinary_mode, [], ?ALL_CASES},
+ {ordinary_mode, [], [dots_in_host_are_turned_to_underscore | ?ALL_CASES]},
22
{all_metrics_are_global, [], ?ALL_CASES}
23
].
24
@@ -83,6 +83,13 @@ subscriptions_initialised(_C) ->
83
mongoose_metrics:init(),
84
true = wait_for_update(exometer:get_value([carbon, packets], count), 60).
85
86
+dots_in_host_are_turned_to_underscore(_C) ->
87
+ mongoose_metrics:init(),
88
+ mongoose_metrics:ensure_metric(<<"host.with.dots">>, [a, metric, value], histogram),
89
+ mongoose_metrics:update(<<"host.with.dots">>, [a, metric, value], 10),
90
+ {ok, _} = exometer:get_value([<<"host_with_dots">>, a, metric, value]).
91
+
92
93
wait_for_update({ok, [{count,X}]}, 0) ->
94
X > 0;
95
wait_for_update({ok, [{count,X}]}, _N) when X > 0 ->
0 commit comments