Class: NewRelic::Binding::Component
- Inherits:
-
Object
- Object
- NewRelic::Binding::Component
- Defined in:
- lib/newrelic_platform_binding/component.rb
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
-
#last_delivered_at ⇒ Object
Returns the value of attribute last_delivered_at.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(name, guid) ⇒ Component
constructor
A new instance of Component.
- #key ⇒ Object
Constructor Details
#initialize(name, guid) ⇒ Component
Returns a new instance of Component.
7 8 9 10 11 |
# File 'lib/newrelic_platform_binding/component.rb', line 7 def initialize(name, guid) @name = name @guid = guid @last_delivered_at = nil end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
4 5 6 |
# File 'lib/newrelic_platform_binding/component.rb', line 4 def guid @guid end |
#last_delivered_at ⇒ Object
Returns the value of attribute last_delivered_at.
5 6 7 |
# File 'lib/newrelic_platform_binding/component.rb', line 5 def last_delivered_at @last_delivered_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/newrelic_platform_binding/component.rb', line 4 def name @name end |
Instance Method Details
#duration ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/newrelic_platform_binding/component.rb', line 17 def duration if last_delivered_at.nil? return NewRelic::Binding::Config.poll_cycle_period else return (Time.now - last_delivered_at).ceil end end |
#key ⇒ Object
13 14 15 |
# File 'lib/newrelic_platform_binding/component.rb', line 13 def key return (name + guid) end |