X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fbeam_stats_consumer.erl;h=eb8cbb7d2094b8ae8dca88c748ceca48a0f52295;hb=263d0e35581f65a71c7a5ffeecfd25543e48b862;hp=8d25fa4d914e5128fceb742a7ec021c5fff046d2;hpb=caf75ed8160362773766c6bde005cf5f33544392;p=beam_stats.git diff --git a/src/beam_stats_consumer.erl b/src/beam_stats_consumer.erl index 8d25fa4..eb8cbb7 100644 --- a/src/beam_stats_consumer.erl +++ b/src/beam_stats_consumer.erl @@ -37,7 +37,7 @@ %% ============================================================================ -callback init(Options :: term()) -> - {ConsumptionInterval :: erlang:time(), State :: term()}. + {ConsumptionInterval :: non_neg_integer(), State :: term()}. -callback consume(queue(), State) -> State. @@ -52,9 +52,9 @@ -define(SIGNAL_CONSUMPTION , beam_stats_consumption_signal). -record(state, - { consumer_module :: atom() + { consumer_module :: module() , consumer_state :: term() - , consumption_interval :: erlang:time() + , consumption_interval :: non_neg_integer() , beam_stats_queue :: queue() }). @@ -62,7 +62,7 @@ %% Public API %% ============================================================================ --spec add(atom(), term()) -> +-spec add(module(), term()) -> supervisor:startchild_ret(). add(ConsumerModule, ConsumerOptions) -> beam_stats_sup_consumers:start_child(ConsumerModule, ConsumerOptions). @@ -136,7 +136,7 @@ schedule_first_consumption() -> _ = self() ! ?SIGNAL_CONSUMPTION, ok. --spec schedule_next_consumption(erlang:time()) -> +-spec schedule_next_consumption(non_neg_integer()) -> ok. schedule_next_consumption(Time) -> _ = erlang:send_after(Time, self(), ?SIGNAL_CONSUMPTION),