@@ -222,12 +222,12 @@ metric_enabled(Name, Metrics) ->
222222
223223collect_allocator_metrics () ->
224224 Metrics = lists :flatten ([
225- collect_allocator_metrics_ (Alloc , Instance , Info )
225+ collect_allocator_metrics_1 (Alloc , Instance , Info )
226226 || {{Alloc , Instance }, Info } <- allocators ()
227227 ]),
228228 prometheus_model_helpers :gauge_metrics (Metrics ).
229229
230- collect_allocator_metrics_ (Alloc , Instance , Info ) ->
230+ collect_allocator_metrics_1 (Alloc , Instance , Info ) ->
231231 [
232232 [
233233 allocator_metric (Alloc , Instance , Kind , Key , KindInfo )
@@ -248,17 +248,21 @@ allocator_metric(Alloc, Instance, Kind, Key, Values) ->
248248 }.
249249
250250% % Originally copied from recon_alloc.
251+ % % versions is deleted because never really having come across a case where it was useful to know.
251252allocators () ->
252253 Allocators = erlang :system_info (alloc_util_allocators ),
253- % % versions is deleted in order to allow the use of the orddict api,
254- % % and never really having come across a case where it was useful to know.
255- [
256- {{A , N }, lists :sort (proplists :delete (versions , Props ))}
257- || A <- Allocators ,
258- Allocs <- [erlang :system_info ({allocator , A })],
259- Allocs =/= false ,
260- {_ , N , Props } <- Allocs
261- ].
254+ lists :flatmap (fun allocator /1 , Allocators ).
255+
256+ allocator (A ) ->
257+ case erlang :system_info ({allocator , A }) of
258+ false ->
259+ [];
260+ Allocs ->
261+ [
262+ {{A , N }, lists :sort (proplists :delete (versions , Props ))}
263+ || {_ , N , Props } <- Allocs
264+ ]
265+ end .
262266
263267allocator_blocks_metric (Alloc , Instance , Kind , count , KindInfo ) ->
264268 Count =
0 commit comments