Class: Lens::EventFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/lens/event_formatter.rb

Instance Method Summary collapse

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

#formattedObject



14
15
16
# File 'lib/lens/event_formatter.rb', line 14

def formatted
  @formatted ||= { data: event_data }
end

#json_formattedObject



10
11
12
# File 'lib/lens/event_formatter.rb', line 10

def json_formatted
  formatted.to_json
end