Class: RailsPerformance::Models::Record
- Inherits:
-
Object
- Object
- RailsPerformance::Models::Record
- Defined in:
- lib/rails_performance/models/record.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#datetime ⇒ Object
readonly
Returns the value of attribute datetime.
-
#datetimei ⇒ Object
readonly
Returns the value of attribute datetimei.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #controller_action ⇒ Object
- #controller_action_format ⇒ Object
-
#initialize(key, value) ⇒ Record
constructor
key = performance| controller|HomeController| action|index| format|html| status|200| datetime|20200124T0523| datetimei|1579861423| method|GET| path|/| request_id|454545454545454545| END = “view_runtime”:8.444603008683771,“db_runtime”:0,“duration”:9“view_runtime”:8.444603008683771,“db_runtime”:0,“duration”:9.216095000000001 value = JSON.
- #value ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Record
key = performance| controller|HomeController| action|index| format|html| status|200| datetime|20200124T0523| datetimei|1579861423| method|GET| path|/| request_id|454545454545454545| END
RailsPerformance::Models::Record.“view_runtime”:8.444603008683771,“db_runtime”:0,“duration”:9“view_runtime”:8.444603008683771,“db_runtime”:0,“duration”:9.216095000000001
value = JSON
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rails_performance/models/record.rb', line 19 def initialize(key, value) @json = value items = key.split("|") @controller = items[2] @action = items[4] @format = items[6] @status = items[8] @datetime = items[10] @datetimei = items[12] @method = items[14] @path = items[16] @request_id = items[18] end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def controller @controller end |
#datetime ⇒ Object (readonly)
Returns the value of attribute datetime.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def datetime @datetime end |
#datetimei ⇒ Object (readonly)
Returns the value of attribute datetimei.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def datetimei @datetimei end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def format @format end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def path @path end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def request_id @request_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/rails_performance/models/record.rb', line 4 def status @status end |
Instance Method Details
#controller_action ⇒ Object
39 40 41 |
# File 'lib/rails_performance/models/record.rb', line 39 def controller_action "#{controller}##{action}" end |
#controller_action_format ⇒ Object
43 44 45 |
# File 'lib/rails_performance/models/record.rb', line 43 def controller_action_format "#{controller}##{action}|#{format}" end |
#value ⇒ Object
35 36 37 |
# File 'lib/rails_performance/models/record.rb', line 35 def value @value ||= JSON.parse(@json || "{}") end |