Align proposal code with proposal README, add missing make* on Metrics (#5)
May resolve #4 if that was the original intent of using the API
This commit is contained in:
parent
ac6fe4405f
commit
4554b8eea6
|
|
@ -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 final class CachingMetricsHandler: MetricsHandler {
|
||||||
private let wrapped: MetricsHandler
|
private let wrapped: MetricsHandler
|
||||||
private var counters = Cache<Counter>()
|
private var counters = Cache<Counter>()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue