Class: Salus::Metric::Value
- Inherits:
-
Struct
- Object
- Struct
- Salus::Metric::Value
- Defined in:
- lib/salus/metric.rb
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#timestamp ⇒ Object
Returns the value of attribute timestamp
23 24 25 |
# File 'lib/salus/metric.rb', line 23 def @timestamp end |
#ttl ⇒ Object
Returns the value of attribute ttl
23 24 25 |
# File 'lib/salus/metric.rb', line 23 def ttl @ttl end |
#value ⇒ Object
Returns the value of attribute value
23 24 25 |
# File 'lib/salus/metric.rb', line 23 def value @value end |
Instance Method Details
#expired?(ts = nil) ⇒ Boolean
24 25 26 27 28 |
# File 'lib/salus/metric.rb', line 24 def expired?(ts=nil) return false if ttl.nil? ts ||= Time.now.to_f ts > ( + ttl) end |