struct Prometheus::Sample

Overview

Represents a single sample value at a point in time.

A Sample combines:

Samples are used to represent the actual data points collected by metrics. The Sample format follows the Prometheus exposition format:

metric_name{label="value"} 42
# Or with timestamp:
metric_name{label="value"} 42 1234567890

Defined in:

types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, labels : Hash(String, String), value : Float64, timestamp : Int64 | Nil = nil) #

def self.new(name : String, labels : LabelSet, value : Float64, timestamp : Int64 | Nil = nil) #

Instance Method Detail

def ==(other : self) #

def collect(io : IO) : Nil #

def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def labels : LabelSet #

def name : String #

def timestamp : Int64 | Nil #

def to_s(io : IO) #
Description copied from struct Struct

Same as #inspect(io).


def value : Float64 #