Sha256: 53933f87e660d09be370f83faec2db2a6a45c544fefdc4c81a7dd89a4ea7095d
Contents?: true
Size: 439 Bytes
Versions: 21
Compression:
Stored size: 439 Bytes
Contents
# frozen_string_literal: true module PrometheusExporter::Metric class Gauge < Base attr_reader :data def initialize(name, help) super @data = {} end def type "gauge" end def metric_text @data.map do |labels, value| "#{prefix(@name)}#{labels_text(labels)} #{value}" end.join("\n") end def observe(value, labels = {}) @data[labels] = value end end end
Version data entries
21 entries across 21 versions & 1 rubygems