recordMilliseconds(_:)
Record a duration in milliseconds.
func recordMilliseconds<DataType>(_ duration: DataType) where DataType : BinaryFloatingPoint
Parameters
- duration
Duration to record.
Record a duration in milliseconds.
func recordMilliseconds<DataType>(_ duration: DataType) where DataType : BinaryFloatingPoint
Duration to record.
import CoreMetrics
A Metrics API package for Swift.
final class Timer
A timer collects observations within a time window (usually things like request durations) and provides aggregated information about the data sample, for example, min, max and various quantiles. It is similar to a Recorder
but specialized for values that represent durations.
protocol BinaryFloatingPoint : ExpressibleByFloatLiteral, FloatingPoint
A radix-2 (binary) floating-point type.
convenience init(label: String, dimensions: [(String, String)] = [])
Create a new Timer
.
init(label: String, dimensions: [(String, String)], handler: TimerHandler)
Alternative way to create a new Timer
, while providing an explicit TimerHandler
.
convenience init(label: String, dimensions: [(String, String)] = [], preferredDisplayUnit displayUnit: TimeUnit)
Create a new Timer
.
let _handler: TimerHandler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
var description: String { get }
let dimensions: [(String, String)]
let label: String
func destroy()
Signal the underlying metrics library that this timer will never be updated again. In response the library MAY decide to eagerly release any resources held by this Timer
.
func recordMicroseconds<DataType>(_ duration: DataType) where DataType : BinaryFloatingPoint
Record a duration in microseconds.
func recordMicroseconds<DataType>(_ duration: DataType) where DataType : BinaryInteger
Record a duration in microseconds.
func recordMilliseconds<DataType>(_ duration: DataType) where DataType : BinaryInteger
Record a duration in milliseconds.
func recordNanoseconds(_ duration: Int64)
Record a duration in nanoseconds.
func recordNanoseconds<DataType>(_ duration: DataType) where DataType : BinaryInteger
Record a duration in nanoseconds.
func recordSeconds<DataType>(_ duration: DataType) where DataType : BinaryFloatingPoint
Record a duration in seconds.
func recordSeconds<DataType>(_ duration: DataType) where DataType : BinaryInteger
Record a duration in seconds.