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.
-
#completed_memory ⇒ Object
Returns the value of attribute completed_memory.
-
#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.
-
#memory_during ⇒ Object
Returns the value of attribute memory_during.
-
#method ⇒ Object
Returns the value of attribute method.
-
#net_http_during ⇒ Object
Returns the value of attribute net_http_during.
-
#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.
-
#url ⇒ Object
Returns the value of attribute url.
-
#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.
- #net_http_requests ⇒ Object
- #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 |
#completed_memory ⇒ Object
Returns the value of attribute completed_memory.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def completed_memory @completed_memory 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 |
#memory_during ⇒ Object
Returns the value of attribute memory_during.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def memory_during @memory_during 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 |
#net_http_during ⇒ Object
Returns the value of attribute net_http_during.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def net_http_during @net_http_during 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 |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'app/models/simple_apm/request.rb', line 4 def url @url 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
30 31 32 |
# File 'app/models/simple_apm/request.rb', line 30 def create(h) SimpleApm::Redis.hmset key, h['request_id'], h.to_json end |
Instance Method Details
#net_http_requests ⇒ Object
15 16 17 |
# File 'app/models/simple_apm/request.rb', line 15 def net_http_requests @requests ||= SimpleApm::HttpRequest.find_by_request_id(request_id) end |
#sqls ⇒ Object
19 20 21 |
# File 'app/models/simple_apm/request.rb', line 19 def sqls @sqls ||= SimpleApm::Sql.find_by_request_id(request_id) end |