module Appsignal::Helpers::Metrics

def add_distribution_value(name, value, tags = {})

Other tags:
    See: https://docs.appsignal.com/metrics/custom.html -

Returns:
  • (void) -

Parameters:
  • tags (Hash) -- The tags for the metric. The Hash
  • value (Integer, Float) -- The value of the metric.
  • name (String, Symbol) -- The name of the metric.

Other tags:
    Since: - 2.6.0
def add_distribution_value(name, value, tags = {})
  Appsignal::Extension.add_distribution_value(
    name.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.internal_logger
    .warn("The distribution value '#{value}' for metric '#{name}' is too big")
end

def increment_counter(name, value = 1.0, tags = {})

Other tags:
    See: https://docs.appsignal.com/metrics/custom.html -

Returns:
  • (void) -

Parameters:
  • tags (Hash) -- The tags for the metric. The Hash
  • value (Integer, Float) -- The value of the metric.
  • name (String, Symbol) -- The name of the metric.

Other tags:
    Since: - 2.6.0
def increment_counter(name, value = 1.0, tags = {})
  Appsignal::Extension.increment_counter(
    name.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.internal_logger
    .warn("The counter value '#{value}' for metric '#{name}' is too big")
end

def set_gauge(name, value, tags = {})

Other tags:
    See: https://docs.appsignal.com/metrics/custom.html -

Returns:
  • (void) -

Parameters:
  • tags (Hash) -- The tags for the metric. The Hash
  • value (Integer, Float) -- The value of the metric.
  • name (String, Symbol) -- The name of the metric.

Other tags:
    Since: - 2.6.0
def set_gauge(name, value, tags = {})
  Appsignal::Extension.set_gauge(
    name.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.internal_logger
    .warn("The gauge value '#{value}' for metric '#{name}' is too big")
end