class Metrux::Commands::Gauge

Constants

GAUGE_MEASUREMENT_PREFIX_KEY

Public Instance Methods

execute(key, params = {}) { || ... } click to toggle source
# File lib/metrux/commands/gauge.rb, line 6
def execute(key, params = {})
  block_given? ? gauge(key, params) { yield } : gauge(key, params)
end
gauge(key, params = {}) { |: fetch(:result)| ... } click to toggle source
# File lib/metrux/commands/gauge.rb, line 10
def gauge(key, params = {})
  key = "#{GAUGE_MEASUREMENT_PREFIX_KEY}#{key}"

  result = block_given? ? yield : params.fetch(:result)

  write(key, format_data(result, params), format_write_options(params))

  result
end