Classes

The following classes are available globally.

User API

  • 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.

    This is the user-facing Counter API.

    Its behavior depends on the CounterHandler implementation.

    See more

    Declaration

    Swift

    public class Counter
    extension Counter: CustomStringConvertible
  • 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.

    This is the user-facing FloatingPointCounter API.

    Its behavior depends on the FloatingCounterHandler implementation.

    See more

    Declaration

    Swift

    public class FloatingPointCounter
    extension FloatingPointCounter: CustomStringConvertible
  • A recorder collects observations within a time window (usually things like response sizes) and can provide aggregated information about the data sample, for example, count, sum, min, max and various quantiles.

    This is the user-facing Recorder API.

    Its behavior depends on the RecorderHandler implementation.

    See more

    Declaration

    Swift

    public class Recorder
    extension Recorder: CustomStringConvertible
  • A gauge is a metric that represents a single numerical value that can arbitrarily go up and down. Gauges 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. Gauges are modeled as Recorder with a sample size of 1 and that does not perform any aggregation.

    See more

    Declaration

    Swift

    public class Gauge : Recorder
  • 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.

    This is the user-facing Timer API.

    Its behavior depends on the TimerHandler implementation.

    See more

    Declaration

    Swift

    public class Timer
    extension Timer: CustomStringConvertible

Predefined Metrics Handlers