func record()

in Sources/StatsdClient/StatsdClient.swift [187:199]


    func record(_ value: Int64) {
        // https://github.com/b/statsd_spec#histograms
        // A histogram is a measure of the distribution of timer values over time, calculated at the server.
        // As the data exported for timers and histograms is the same, this is currently an alias for a timer.
        // Valid histogram values are in the range [0, 2^64^).
        // https://github.com/b/statsd_spec#gauges
        // A gauge is an instantaneous measurement of a value, like the gas gauge in a car.
        // It differs from a counter by being calculated at the client rather than the server.
        // Valid gauge values are in the range [0, 2^64^)
        let type: MetricType = self.aggregate ? .histogram : .gauge
        let value = Swift.max(0, value)
        _ = self.client.emit(Metric(name: self.id, value: value, type: type))
    }