Sha256: 6ed0917177e0aadcac63e210867c8538fd3686cac6b7b648f4f94d680e1dfae6
Contents?: true
Size: 1.55 KB
Versions: 32
Compression:
Stored size: 1.55 KB
Contents
# frozen_string_literal: true module Appsignal module Helpers # @api private module Metrics def set_gauge(key, value, tags = {}) Appsignal::Extension.set_gauge( key.to_s, value.to_f, Appsignal::Utils::Data.generate(tags) ) rescue RangeError Appsignal.logger .warn("Gauge value #{value} for key '#{key}' is too big") end def set_host_gauge(key, value) Appsignal::Extension.set_host_gauge(key.to_s, value.to_f) rescue RangeError Appsignal.logger .warn("Host gauge value #{value} for key '#{key}' is too big") end def set_process_gauge(key, value) Appsignal::Extension.set_process_gauge(key.to_s, value.to_f) rescue RangeError Appsignal.logger .warn("Process gauge value #{value} for key '#{key}' is too big") end def increment_counter(key, value = 1.0, tags = {}) Appsignal::Extension.increment_counter( key.to_s, value.to_f, Appsignal::Utils::Data.generate(tags) ) rescue RangeError Appsignal.logger .warn("Counter value #{value} for key '#{key}' is too big") end def add_distribution_value(key, value, tags = {}) Appsignal::Extension.add_distribution_value( key.to_s, value.to_f, Appsignal::Utils::Data.generate(tags) ) rescue RangeError Appsignal.logger .warn("Distribution value #{value} for key '#{key}' is too big") end end end end
Version data entries
32 entries across 32 versions & 1 rubygems