Instance Propertyswift-metrics 2.6.1CoreMetrics
_handler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
let _handler: RecorderHandler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
let _handler: RecorderHandler
import CoreMetrics
A Metrics API package for Swift.
class Recorder
A recorder collects observations within a time window (usually things like response sizes) and can provide aggregated information about the data sample, for example, count, sum, min, max and various quantiles.
protocol RecorderHandler : AnyObject, _SwiftMetricsSendableProtocol
A RecorderHandler
represents a backend implementation of a Recorder
.
convenience init(label: String, dimensions: [(String, String)] = [], aggregate: Bool = true)
Create a new Recorder
.
init(label: String, dimensions: [(String, String)], aggregate: Bool, handler: RecorderHandler)
Alternative way to create a new Recorder
, while providing an explicit RecorderHandler
.
let aggregate: Bool
var description: String { get }
let dimensions: [(String, String)]
let label: String
func destroy()
Signal the underlying metrics library that this recorder will never be updated again. In response the library MAY decide to eagerly release any resources held by this Recorder
.
func record<DataType>(_ value: DataType) where DataType : BinaryFloatingPoint
Record a value.
func record<DataType>(_ value: DataType) where DataType : BinaryInteger
Record a value.