Class: TraceViz::Exporters::BaseExporter
- Inherits:
-
Object
- Object
- TraceViz::Exporters::BaseExporter
- Includes:
- Helpers::ConfigHelper, Shared::RendererHelper
- Defined in:
- lib/trace_viz/exporters/base_exporter.rb
Direct Known Subclasses
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(collector) ⇒ BaseExporter
constructor
A new instance of BaseExporter.
Methods included from Shared::RendererHelper
Methods included from Helpers::ConfigHelper
#config, #fetch_general_config
Constructor Details
#initialize(collector) ⇒ BaseExporter
Returns a new instance of BaseExporter.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/trace_viz/exporters/base_exporter.rb', line 15 def initialize(collector) @export_config = config.export @logger = config.logger @collector = collector @renderer = Renderers::RendererBuilder.build( collector, key: renderer_mode, formatter_factory: Formatters::Export::FormatterFactory.new, ) end |
Instance Method Details
#export ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/trace_viz/exporters/base_exporter.rb', line 28 def export unless export_enabled? logger.warn("Export is disabled in configuration. Skipping export process.") return end ensure_directory_exists return if handle_empty_content == :skip return if handle_existing_file == :skip write_file(content) logger.exported("Data successfully exported to #{file_path}") end |