Instance Methodswift-metrics 2.6.1CoreMetrics
increment
Increment the counter by one.
func increment()
Increment the counter by one.
func increment()
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.
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.
var description: String { get }
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<DataType>(by amount: DataType) where DataType : BinaryInteger
Increment the counter.
func reset()
Reset the counter back to zero.