Skip to content

Commit e940f68

Browse files
fix(patch): [sc-1297] use lock for subsummary to get its values
1 parent 2095e26 commit e940f68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Prometheus/MetricTypes/Summary.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class PromSummary<NumType: DoubleRepresentable>: PromMetric {
9292
output.append("\(self.name)_sum \(format(self.sum.get().doubleValue))")
9393

9494
subSummaries.forEach { labels, subSum in
95-
let subSumValues = lock.withLock { subSum.values }
95+
let subSumValues = subSum.lock.withLock { subSum.values }
9696
calculateQuantiles(quantiles: self.quantiles, values: subSumValues.map { $0.doubleValue }).sorted { $0.key < $1.key }.forEach { (arg) in
9797
let (q, v) = arg
9898
let labelsString = encodeLabels(EncodableSummaryLabels(labels: labels, quantile: "\(q)"))

0 commit comments

Comments
 (0)