Class: Jetmeter::LabelAccumulator
- Inherits:
-
Object
- Object
- Jetmeter::LabelAccumulator
- Defined in:
- lib/jetmeter/label_accumulator.rb
Constant Summary collapse
- LABELED_EVENT =
'labeled'.freeze
- UNLABELED_EVENT =
'unlabeled'.freeze
- CORRESPONDING_EVENTS_LIMIT =
15
- MAX_LABEL_CHANGE_TIME =
60
Instance Attribute Summary collapse
-
#additive ⇒ Object
readonly
Returns the value of attribute additive.
Instance Method Summary collapse
-
#initialize(additive: true) ⇒ LabelAccumulator
constructor
A new instance of LabelAccumulator.
- #valid?(event, flow) ⇒ Boolean
Constructor Details
#initialize(additive: true) ⇒ LabelAccumulator
Returns a new instance of LabelAccumulator.
10 11 12 13 |
# File 'lib/jetmeter/label_accumulator.rb', line 10 def initialize(additive: true) @corresponding_events = { LABELED_EVENT => [], UNLABELED_EVENT => [] } @additive = additive end |
Instance Attribute Details
#additive ⇒ Object (readonly)
Returns the value of attribute additive.
8 9 10 |
# File 'lib/jetmeter/label_accumulator.rb', line 8 def additive @additive end |
Instance Method Details
#valid?(event, flow) ⇒ Boolean
15 16 17 18 19 20 |
# File 'lib/jetmeter/label_accumulator.rb', line 15 def valid?(event, flow) return false unless event.issue_event? store_corresponding_event(event) labeling_transition?(flow, event) || unlabeling_transition?(flow, event) end |