Class: Kolekti::MemoryPersistenceStrategy
- Inherits:
-
PersistenceStrategy
- Object
- PersistenceStrategy
- Kolekti::MemoryPersistenceStrategy
- Defined in:
- lib/kolekti/memory_persistence_strategy.rb
Instance Attribute Summary collapse
-
#hotspot_metric_results ⇒ Object
readonly
Returns the value of attribute hotspot_metric_results.
-
#related_hotspot_metric_results ⇒ Object
readonly
Returns the value of attribute related_hotspot_metric_results.
-
#tree_metric_results ⇒ Object
readonly
Returns the value of attribute tree_metric_results.
Instance Method Summary collapse
- #create_hotspot_metric_result(metric_configuration, module_name, line, message) ⇒ Object
- #create_related_hotspot_metric_results(metric_configuration, results) ⇒ Object
- #create_tree_metric_result(metric_configuration, module_name, value, granularity) ⇒ Object
-
#initialize ⇒ MemoryPersistenceStrategy
constructor
A new instance of MemoryPersistenceStrategy.
Constructor Details
#initialize ⇒ MemoryPersistenceStrategy
Returns a new instance of MemoryPersistenceStrategy.
7 8 9 10 11 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 7 def initialize @tree_metric_results = [] @hotspot_metric_results = [] @related_hotspot_metric_results = [] end |
Instance Attribute Details
#hotspot_metric_results ⇒ Object (readonly)
Returns the value of attribute hotspot_metric_results.
5 6 7 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 5 def hotspot_metric_results @hotspot_metric_results end |
#related_hotspot_metric_results ⇒ Object (readonly)
Returns the value of attribute related_hotspot_metric_results.
5 6 7 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 5 def @related_hotspot_metric_results end |
#tree_metric_results ⇒ Object (readonly)
Returns the value of attribute tree_metric_results.
5 6 7 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 5 def tree_metric_results @tree_metric_results end |
Instance Method Details
#create_hotspot_metric_result(metric_configuration, module_name, line, message) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 22 def create_hotspot_metric_result(metric_configuration, module_name, line, ) result = { metric_configuration: metric_configuration, module_name: module_name, line: line, message: } @hotspot_metric_results << result result end |
#create_related_hotspot_metric_results(metric_configuration, results) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 33 def (metric_configuration, results) = [] results.each do |result| result = create_hotspot_metric_result(metric_configuration, result['module_name'], result['line'], result['message']) << result end << end |
#create_tree_metric_result(metric_configuration, module_name, value, granularity) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/kolekti/memory_persistence_strategy.rb', line 13 def create_tree_metric_result(metric_configuration, module_name, value, granularity) @tree_metric_results << { metric_configuration: metric_configuration, module_name: module_name, value: value, granularity: granularity } end |