class NewrelicSphinx::Metric

Attributes

key[R]
last_value[R]
mode[R]
name[R]
units[R]
value[RW]

Public Class Methods

new(key, name, units, mode = :plain) click to toggle source
# File lib/newrelic_sphinx/agent.rb, line 11
def initialize(key, name, units, mode = :plain)
  @key, @name, @units, @mode = key, name, units, mode
  @value = 0
  @last_value = 0
end

Public Instance Methods

incremental?() click to toggle source
# File lib/newrelic_sphinx/agent.rb, line 25
def incremental?
  mode == :incremental
end
memorize() click to toggle source
# File lib/newrelic_sphinx/agent.rb, line 17
def memorize
  @last_value = value
end
plain?() click to toggle source
# File lib/newrelic_sphinx/agent.rb, line 21
def plain?
  mode == :plain
end