Class: Lens::EventFormatter
- Inherits:
-
Object
- Object
- Lens::EventFormatter
- Defined in:
- lib/lens/event_formatter.rb
Instance Method Summary collapse
- #formatted ⇒ Object
-
#initialize(event, records, gc_time = 0.0, allocations_data = Lens::AllocationsData.new) ⇒ EventFormatter
constructor
A new instance of EventFormatter.
- #json_formatted ⇒ Object
Constructor Details
#initialize(event, records, gc_time = 0.0, allocations_data = Lens::AllocationsData.new) ⇒ EventFormatter
Returns a new instance of EventFormatter.
3 4 5 6 7 8 |
# File 'lib/lens/event_formatter.rb', line 3 def initialize(event, records, gc_time = 0.0, allocations_data = Lens::AllocationsData.new) @event = event @records = records.map{|payload| filter_payload(payload)} @gc_time = gc_time @allocations_data = allocations_data end |
Instance Method Details
#formatted ⇒ Object
14 15 16 |
# File 'lib/lens/event_formatter.rb', line 14 def formatted @formatted ||= { data: event_data } end |
#json_formatted ⇒ Object
10 11 12 |
# File 'lib/lens/event_formatter.rb', line 10 def json_formatted formatted.to_json end |