Browse Source

Use begin-end block with at-lock macro to help coverage

pull/13/head
Fredrik Ekre 2 years ago
parent
commit
4859c51225
  1. 6
      src/Prometheus.jl

6
src/Prometheus.jl

@ -1042,8 +1042,10 @@ end @@ -1042,8 +1042,10 @@ end
function expose_io(io::IO, reg::CollectorRegistry)
# Collect all metrics
metrics = Metric[]
@lock reg.lock for collector in reg.collectors
collect!(metrics, collector)
@lock reg.lock begin
for collector in reg.collectors
collect!(metrics, collector)
end
end
sort!(metrics; by = metric -> metric.metric_name)
# Write to IO

Loading…
Cancel
Save