Class: Atatus::Collector::Layer
- Inherits:
-
Object
- Object
- Atatus::Collector::Layer
- Defined in:
- lib/atatus/collector/layer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#id ⇒ Object
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #aggregate!(duration) ⇒ Object
-
#initialize(type, kind, duration) ⇒ Layer
constructor
A new instance of Layer.
Constructor Details
#initialize(type, kind, duration) ⇒ Layer
Returns a new instance of Layer.
5 6 7 8 9 10 11 12 |
# File 'lib/atatus/collector/layer.rb', line 5 def initialize(type, kind, duration) @type = type @kind = kind @count = 1 @min = duration @max = duration @total = duration end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def count @count end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/atatus/collector/layer.rb', line 15 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def kind @kind end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def min @min end |
#pid ⇒ Object
Returns the value of attribute pid.
15 16 17 |
# File 'lib/atatus/collector/layer.rb', line 15 def pid @pid end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def total @total end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/atatus/collector/layer.rb', line 14 def type @type end |
Class Method Details
.span_kind(value) ⇒ Object
24 25 26 |
# File 'lib/atatus/collector/layer.rb', line 24 def self.span_kind(value) return KINDS.fetch(value, value) end |
.span_type(value) ⇒ Object
28 29 30 |
# File 'lib/atatus/collector/layer.rb', line 28 def self.span_type(value) return TYPES.fetch(value, value) end |
Instance Method Details
#aggregate!(duration) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/atatus/collector/layer.rb', line 17 def aggregate!(duration) @count += 1 @min = duration if duration < @min @max = duration if duration > @max @total += duration end |