Class: Naplug::Helpers::ENGraphite::Metric

Inherits:
Object
  • Object
show all
Defined in:
lib/naplug/helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, value, time = Time.now) ⇒ Metric

Returns a new instance of Metric.



80
81
82
83
84
# File 'lib/naplug/helpers.rb', line 80

def initialize(path,value,time = Time.now)
  @path = path
  @value = value
  @time = time
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



78
79
80
# File 'lib/naplug/helpers.rb', line 78

def path
  @path
end

#timeObject (readonly)

Returns the value of attribute time.



78
79
80
# File 'lib/naplug/helpers.rb', line 78

def time
  @time
end

#valueObject (readonly)

Returns the value of attribute value.



78
79
80
# File 'lib/naplug/helpers.rb', line 78

def value
  @value
end

Instance Method Details

#to_sObject



86
87
88
# File 'lib/naplug/helpers.rb', line 86

def to_s
  '%s %d %d' % [@path,@value,@time.to_i]
end