_handler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
let _handler: MeterHandler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
let _handler: MeterHandler
import CoreMetrics
A Metrics API package for Swift.
final class Meter
A meter is similar to a gauge, it is a metric that represents a single numerical value that can arbitrarily go up and down. Meters are typically used for measured values like temperatures or current memory usage, but also “counts” that can go up and down, like the number of active threads.
protocol MeterHandler : AnyObject, _SwiftMetricsSendableProtocol
A MeterHandler
represents a backend implementation of a Meter
.
convenience init(label: String, dimensions: [(String, String)] = [])
Create a new Meter
.
init(label: String, dimensions: [(String, String)], handler: MeterHandler)
Alternative way to create a new Meter
, while providing an explicit MeterHandler
.
var description: String { get }
let dimensions: [(String, String)]
let label: String
func decrement()
Decrement the Meter by one.
func decrement<DataType>(by amount: DataType) where DataType : BinaryFloatingPoint
Decrement the Meter.
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 increment()
Increment the Meter by one.
func increment<DataType>(by amount: DataType) where DataType : BinaryFloatingPoint
Increment the Meter.
func set<DataType>(_ value: DataType) where DataType : BinaryFloatingPoint
Set a value.
func set<DataType>(_ value: DataType) where DataType : BinaryInteger
Set a value.