+-spec produce_sync(state()) ->
+ state().
+produce_sync(#state{}=State) ->
+ produce(State, fun beam_stats_consumer:consume_sync/2).
+
+-spec produce_async(state()) ->
+ state().
+produce_async(#state{}=State) ->
+ produce(State, fun beam_stats_consumer:consume_async/2).
+
+-spec produce(state(), fun((pid(), term()) -> ok)) ->
+ state().
+produce(
+ #state
+ { consumers = ConsumersSet
+ , deltas_server = DeltasServer
+ }=State,
+ MsgSendFun
+) ->
+ Stats = beam_stats:collect(DeltasServer),