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
function expose_io(io::IO, reg::CollectorRegistry) function expose_io(io::IO, reg::CollectorRegistry)
# Collect all metrics # Collect all metrics
metrics = Metric[] metrics = Metric[]
@lock reg.lock for collector in reg.collectors @lock reg.lock begin
collect!(metrics, collector) for collector in reg.collectors
collect!(metrics, collector)
end
end end
sort!(metrics; by = metric -> metric.metric_name) sort!(metrics; by = metric -> metric.metric_name)
# Write to IO # Write to IO

Loading…
Cancel
Save