init(label:dimensions:)
Create a new FloatingPointCounter
.
convenience init(label: String, dimensions: [(String, String)] = [])
Parameters
- label
The label for the
FloatingPointCounter
.- dimensions
The dimensions for the
FloatingPointCounter
.
Create a new FloatingPointCounter
.
convenience init(label: String, dimensions: [(String, String)] = [])
s11CoreMetrics20FloatingPointCounterC5label10dimensionsACSS_SaySS_SStGtcfc
What are these?91UBE
The label for the FloatingPointCounter
.
The dimensions for the FloatingPointCounter
.
import CoreMetrics
A Metrics API package for Swift.
final class FloatingPointCounter
A FloatingPointCounter is a cumulative metric that represents a single monotonically increasing FloatingPointCounter whose value can only increase or be reset to zero. For example, you can use a FloatingPointCounter to represent the number of requests served, tasks completed, or errors. FloatingPointCounter is not supported by all metrics backends, however a default implementation is provided which accumulates floating point values and records increments to a standard Counter after crossing integer boundaries.
@frozen struct String
A Unicode string value that is a collection of characters.
init(label: String, dimensions: [(String, String)], handler: FloatingPointCounterHandler)
Alternative way to create a new FloatingPointCounter
, while providing an explicit FloatingPointCounterHandler
.
let _handler: FloatingPointCounterHandler
_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 FloatingPointCounter will never be updated again. In response the library MAY decide to eagerly release any resources held by this FloatingPointCounter
.
func increment()
Increment the FloatingPointCounter by one.
func increment<DataType>(by amount: DataType) where DataType : BinaryFloatingPoint
Increment the FloatingPointCounter.
func reset()
Reset the FloatingPointCounter back to zero.