Class: RailsPerformance::Models::TraceRecord
- Inherits:
-
BaseRecord
- Object
- BaseRecord
- RailsPerformance::Models::TraceRecord
- Defined in:
- lib/rails_performance/models/trace_record.rb
Instance Attribute Summary collapse
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(request_id:, value:) ⇒ TraceRecord
constructor
A new instance of TraceRecord.
- #save ⇒ Object
Methods inherited from BaseRecord
#duration, from_db, #record_hash
Constructor Details
#initialize(request_id:, value:) ⇒ TraceRecord
Returns a new instance of TraceRecord.
6 7 8 9 |
# File 'lib/rails_performance/models/trace_record.rb', line 6 def initialize(request_id:, value:) @request_id = request_id @value = value end |
Instance Attribute Details
#request_id ⇒ Object
Returns the value of attribute request_id.
4 5 6 |
# File 'lib/rails_performance/models/trace_record.rb', line 4 def request_id @request_id end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/rails_performance/models/trace_record.rb', line 4 def value @value end |
Instance Method Details
#save ⇒ Object
11 12 13 14 15 |
# File 'lib/rails_performance/models/trace_record.rb', line 11 def save return if value.empty? Utils.save_to_redis("trace|#{request_id}|END|#{RailsPerformance::SCHEMA}", value, RailsPerformance.recent_requests_time_window.to_i) end |