diff --git a/Sources/CoreMetrics/Metrics.swift b/Sources/CoreMetrics/Metrics.swift index 84d677f..3fddd6d 100644 --- a/Sources/CoreMetrics/Metrics.swift +++ b/Sources/CoreMetrics/Metrics.swift @@ -118,6 +118,21 @@ public enum Metrics { } } +public extension Metrics { + @inlinable + func makeCounter(label: String, dimensions: [(String, String)]) -> Counter { + return Metrics.global.makeCounter(label: label, dimensions: dimensions) + } + @inlinable + func makeRecorder(label: String, dimensions: [(String, String)], aggregate: Bool) -> Recorder { + return Metrics.global.makeRecorder(label: label, dimensions: dimensions, aggregate: aggregate) + } + @inlinable + func makeTimer(label: String, dimensions: [(String, String)]) -> Timer { + return Metrics.global.makeTimer(label: label, dimensions: dimensions) + } +} + private final class CachingMetricsHandler: MetricsHandler { private let wrapped: MetricsHandler private var counters = Cache()