We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e2140f + 63df074 commit 268afc4Copy full SHA for 268afc4
2 files changed
ci/dummy_scenario.erl
@@ -43,8 +43,8 @@ test_verification_function(_) -> {true, new_value}.
43
44
-spec init() -> ok.
45
init() ->
46
- ok = amoc_metrics:init(counters, dummy_scenario_metric),
47
- ok = amoc_metrics:init(times, dummy_scenario_metric),
+ true = amoc_metrics:init(counters, dummy_scenario_metric),
+ true = amoc_metrics:init(times, dummy_scenario_metric),
48
%% amoc follows a couple of rules during the scenario initialisation:
49
%% - if any parameter verification fails, amoc will not start
50
%% the scenario and the init/0 function is not triggered.
src/amoc_metrics.erl
@@ -23,15 +23,15 @@ start() ->
23
maybe_init_predefined_metrics(),
24
maybe_add_exporter().
25
26
--spec init(type(), name()) -> ok.
+-spec init(type(), name()) -> boolean().
27
init(counters, Name) ->
28
- prometheus_counter:new([{name, Name}, {help, ""}]);
+ prometheus_counter:declare([{name, Name}, {help, ""}]);
29
init(gauge, Name) ->
30
- prometheus_gauge:new([{name, Name}, {help, ""}]);
+ prometheus_gauge:declare([{name, Name}, {help, ""}]);
31
init(summary, Name) ->
32
- prometheus_summary:new([{name, Name}, {help, ""}]);
+ prometheus_summary:declare([{name, Name}, {help, ""}]);
33
init(Type, Name) when histogram =:= Type; times =:= Type ->
34
- prometheus_histogram:new([{name, Name}, {buckets, histogram_buckets()}, {help, ""}]).
+ prometheus_histogram:declare([{name, Name}, {buckets, histogram_buckets()}, {help, ""}]).
35
36
-spec update_counter(name()) -> ok.
37
update_counter(Name) ->
0 commit comments