Skip to content

Commit

Permalink
Merge pull request #4 from esl/fix_users_size_metric
Browse files Browse the repository at this point in the history
Fix [amoc, users, size] metric
  • Loading branch information
chrzaszcz authored Aug 29, 2024
2 parents c4c8016 + 82d8854 commit b6dc37c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/amoc_arsenal.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]},
[]
},
{[amoc, users], {function, ets, info, [amoc_users], proplist, [size]}, []}
{[amoc, users], {function, amoc_metrics, user_size, [], proplist, [size]}, []}
]}
]},
{modules, []},
Expand Down
5 changes: 4 additions & 1 deletion src/amoc_metrics.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(amoc_metrics).

-export([start/0, init/2]).
-export([start/0, init/2, user_size/0]).
-export([update_time/2, update_counter/2, update_counter/1, update_gauge/2]).

-include_lib("kernel/include/logger.hrl").
Expand All @@ -26,6 +26,9 @@ init(Type, Name) ->
ExType = exometer_metric_type(Type),
create_metric_and_maybe_subscribe(ExName, ExType).

-spec user_size() -> [{size, non_neg_integer()}].
user_size() ->
[{size, amoc_users_sup:count_no_of_users()}].

-spec update_time(name(), integer()) -> ok.
update_time(Name, Value) ->
Expand Down

0 comments on commit b6dc37c

Please sign in to comment.