Class: TraceViz::Collectors::BaseCollector
- Inherits:
-
Object
- Object
- TraceViz::Collectors::BaseCollector
- Includes:
- Helpers::ConfigHelper, Helpers::TrackingHelper
- Defined in:
- lib/trace_viz/collectors/base_collector.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#hierarchy ⇒ Object
readonly
Returns the value of attribute hierarchy.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
- #clear ⇒ Object
- #collect(event) ⇒ Object
-
#initialize ⇒ BaseCollector
constructor
To implement collect trace data from the given event, you need to enter the ‘config` context to perform the evaluation.
Methods included from Helpers::TrackingHelper
#active_call_stack, #current_call, #current_depth, #tracker
Methods included from Helpers::ConfigHelper
#config, #fetch_general_config
Constructor Details
#initialize ⇒ BaseCollector
To implement collect trace data from the given event, you need to enter the ‘config` context to perform the evaluation.
19 20 21 22 23 24 25 26 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 19 def initialize setup_logger setup_stats setup_pipeline setup_hierarchy clear end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
15 16 17 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 15 def collection @collection end |
#hierarchy ⇒ Object (readonly)
Returns the value of attribute hierarchy.
15 16 17 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 15 def hierarchy @hierarchy end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
15 16 17 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 15 def renderer @renderer end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
15 16 17 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 15 def stats @stats end |
Instance Method Details
#clear ⇒ Object
40 41 42 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 40 def clear @collection = [] end |
#collect(event) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/trace_viz/collectors/base_collector.rb', line 28 def collect(event) return unless can_collect?(event) trace_data = build_trace(event) processed_data = process_trace(trace_data) return unless processed_data store_trace(processed_data) link_to_hierarchy(processed_data) end |