Skip to content

Commit 697b697

Browse files
incertumktoso
andcommitted
update: apply reviewers suggestions
Co-authored-by: Konrad `ktoso` Malawski <[email protected]> Signed-off-by: Melissa Kilby <[email protected]>
1 parent 7808b75 commit 697b697

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Sources/Prometheus/PrometheusCollectorRegistry.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class PrometheusCollectorRegistry: Sendable {
5252
let help: String
5353
}
5454

55-
private enum BucketType: Sendable, Hashable {
55+
private enum HistogramBuckets: Sendable, Hashable {
5656
case duration([Duration])
5757
case value([Double])
5858
}
@@ -66,17 +66,12 @@ public final class PrometheusCollectorRegistry: Sendable {
6666
/// metric. See also https://github.com/prometheus/OpenMetrics/issues/197.
6767
private struct MetricGroup<Metric: Sendable & AnyObject>: Sendable {
6868
var metricsByLabelSets: [LabelsKey: MetricWithHelp<Metric>]
69-
let buckets: BucketType? // Store buckets for histogram types
69+
let buckets: HistogramBuckets?
7070

71-
init(metricsByLabelSets: [LabelsKey: MetricWithHelp<Metric>] = [:], buckets: BucketType) {
71+
init(metricsByLabelSets: [LabelsKey: MetricWithHelp<Metric>] = [:], buckets: HistogramBuckets? = nil) {
7272
self.metricsByLabelSets = metricsByLabelSets
7373
self.buckets = buckets
7474
}
75-
76-
init(metricsByLabelSets: [LabelsKey: MetricWithHelp<Metric>] = [:]) {
77-
self.metricsByLabelSets = metricsByLabelSets
78-
self.buckets = nil
79-
}
8075
}
8176

8277
private enum Metric {

0 commit comments

Comments
 (0)