Class: SimpleApm::Request
- Inherits:
-
Object
- Object
- SimpleApm::Request
- Defined in:
- app/models/simple_apm/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#action_name ⇒ Object
Returns the value of attribute action_name.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#db_runtime ⇒ Object
Returns the value of attribute db_runtime.
-
#during ⇒ Object
Returns the value of attribute during.
-
#exception ⇒ Object
Returns the value of attribute exception.
-
#format ⇒ Object
Returns the value of attribute format.
-
#host ⇒ Object
Returns the value of attribute host.
-
#method ⇒ Object
Returns the value of attribute method.
-
#remote_addr ⇒ Object
Returns the value of attribute remote_addr.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#started ⇒ Object
Returns the value of attribute started.
-
#status ⇒ Object
Returns the value of attribute status.
-
#view_runtime ⇒ Object
Returns the value of attribute view_runtime.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(h) ⇒ Request
constructor
A new instance of Request.
- #sqls ⇒ Object
Constructor Details
#initialize(h) ⇒ Request
Returns a new instance of Request.
9 10 11 12 13 |
# File 'app/models/simple_apm/request.rb', line 9 def initialize(h) h.each do |k, v| send("#{k}=", v) rescue puts "attr #{k} not set!" end end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def action @action end |
#action_name ⇒ Object
Returns the value of attribute action_name.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def action_name @action_name end |
#controller ⇒ Object
Returns the value of attribute controller.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def controller @controller end |
#db_runtime ⇒ Object
Returns the value of attribute db_runtime.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def db_runtime @db_runtime end |
#during ⇒ Object
Returns the value of attribute during.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def during @during end |
#exception ⇒ Object
Returns the value of attribute exception.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def exception @exception end |
#format ⇒ Object
Returns the value of attribute format.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def format @format end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def host @host end |
#method ⇒ Object
Returns the value of attribute method.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def method @method end |
#remote_addr ⇒ Object
Returns the value of attribute remote_addr.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def remote_addr @remote_addr end |
#request_id ⇒ Object
Returns the value of attribute request_id.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def request_id @request_id end |
#started ⇒ Object
Returns the value of attribute started.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def started @started end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def status @status end |
#view_runtime ⇒ Object
Returns the value of attribute view_runtime.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def view_runtime @view_runtime end |
Class Method Details
.create(h) ⇒ Object
26 27 28 |
# File 'app/models/simple_apm/request.rb', line 26 def create(h) SimpleApm::Redis.hmset key, h['request_id'], h.to_json end |
Instance Method Details
#sqls ⇒ Object
15 16 17 |
# File 'app/models/simple_apm/request.rb', line 15 def sqls @sqls ||= SimpleApm::Sql.find_by_request_id(request_id) end |