Class: RailsPerformance::Reports::TraceReport

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_performance/reports/trace_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_id:) ⇒ TraceReport

Returns a new instance of TraceReport.



6
7
8
# File 'lib/rails_performance/reports/trace_report.rb', line 6

def initialize(request_id:)
  @request_id = request_id
end

Instance Attribute Details

#request_idObject (readonly)

Returns the value of attribute request_id.



4
5
6
# File 'lib/rails_performance/reports/trace_report.rb', line 4

def request_id
  @request_id
end

Instance Method Details

#dataObject



10
11
12
13
# File 'lib/rails_performance/reports/trace_report.rb', line 10

def data
  key = "trace|#{request_id}|END|#{RailsPerformance::SCHEMA}"
  JSON.parse(RailsPerformance.redis.get(key).presence || "[]")
end