description
Metrics.swift:90var description: String { get }
var description: String { get }
import CoreMetrics
A Metrics API package for Swift.
final class Counter
A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.
@frozen struct String
A Unicode string value that is a collection of characters.
convenience init(label: String, dimensions: [(String, String)] = [])
Create a new Counter
.
init(label: String, dimensions: [(String, String)], handler: CounterHandler)
Alternative way to create a new Counter
, while providing an explicit CounterHandler
.
let _handler: CounterHandler
_handler
is only public to allow access from MetricsTestKit
. Do not consider it part of the public API.
let dimensions: [(String, String)]
let label: String
func destroy()
Signal the underlying metrics library that this counter will never be updated again. In response the library MAY decide to eagerly release any resources held by this Counter
.
func increment()
Increment the counter by one.
func increment<DataType>(by amount: DataType) where DataType : BinaryInteger
Increment the counter.
func reset()
Reset the counter back to zero.