Class: Puma::Plugin::Telemetry::Targets::BaseFormattingTarget
- Inherits:
-
Object
- Object
- Puma::Plugin::Telemetry::Targets::BaseFormattingTarget
- Defined in:
- lib/puma/plugin/telemetry/targets/base_formatting_target.rb
Overview
A base class for other Targets concerned with formatting telemetry
Direct Known Subclasses
Instance Method Summary collapse
- #call(_telemetry) ⇒ Object
-
#initialize(formatter: :json, transform: :cloud_watch) ⇒ BaseFormattingTarget
constructor
A new instance of BaseFormattingTarget.
Constructor Details
#initialize(formatter: :json, transform: :cloud_watch) ⇒ BaseFormattingTarget
Returns a new instance of BaseFormattingTarget.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/puma/plugin/telemetry/targets/base_formatting_target.rb', line 14 def initialize(formatter: :json, transform: :cloud_watch) @transform = case transform when :cloud_watch then Transforms::CloudWatchTransform when :passthrough then Transforms::PassthroughTransform else transform end @formatter = case formatter when :json then Formatters::JSONFormatter when :passthrough then Formatters::PassthroughFormatter else formatter end end |
Instance Method Details
#call(_telemetry) ⇒ Object
27 28 29 |
# File 'lib/puma/plugin/telemetry/targets/base_formatting_target.rb', line 27 def call(_telemetry) raise NotImplementedError, "#{__method__} must be implemented by #{self.class.name}" end |