class

Raft::Metrics

Inherits Reference < Object

Constants

HISTOGRAM_BUCKETS = [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 5.0]

Constructors

new(node_id : NodeID, group_id : UInt64 = 0_u64)
Source

Instance methods

get_counter(name : String) : Int64
Source
get_gauge(name : String) : Int64
Source
increment(name : String, by : Int64 = 1_i64)
Source
increment(name : String, labels : Hash(String, String), by : Int64 = 1_i64)
Source
observe(name : String, value : Float64, labels : Hash(String, String) = {} of String => String)
Source
set_gauge(name : String, value : Int64)
Source
to_prometheus(io : IO) : Nil

Locks each metric hash separately. A scrape is not an atomic snapshot across types — gauges, counters, and histograms can advance between the three locks. Acceptable for Prometheus, which treats each line independently.

Source
to_prometheus
Source

Nested types