Class: SlowActions::LogEntry
- Inherits:
-
Object
- Object
- SlowActions::LogEntry
- Defined in:
- lib/slow_actions/slow_actions_log_entry.rb
Overview
Object representing a single entry in a rails application’s log file
Instance Attribute Summary collapse
-
#action ⇒ Object
The #Action.
-
#controller ⇒ Object
The #Controller.
-
#date ⇒ Object
date.
-
#db ⇒ Object
time spent in the database.
-
#duration ⇒ Object
Total duration to complete.
-
#error_text ⇒ Object
error text (if any).
-
#ip ⇒ Object
IP address of user.
-
#method ⇒ Object
HTTP Method.
-
#parameters ⇒ Object
Parameters to the action.
-
#processed ⇒ Object
whether or not is has already been processed by #SlowActions.
-
#rendering ⇒ Object
time spent rendering.
-
#session ⇒ Object
Session ID.
-
#time ⇒ Object
time.
Instance Method Summary collapse
-
#error? ⇒ Boolean
Whether or not this #LogEntry was an error.
-
#initialize ⇒ LogEntry
constructor
Create a new #LogEntry.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ LogEntry
Create a new #LogEntry
6 7 8 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 6 def initialize self.processed = false end |
Instance Attribute Details
#action ⇒ Object
The #Action
12 13 14 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 12 def action @action end |
#controller ⇒ Object
The #Controller
10 11 12 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 10 def controller @controller end |
#date ⇒ Object
date
16 17 18 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 16 def date @date end |
#db ⇒ Object
time spent in the database
30 31 32 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 30 def db @db end |
#duration ⇒ Object
Total duration to complete
26 27 28 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 26 def duration @duration end |
#error_text ⇒ Object
error text (if any)
32 33 34 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 32 def error_text @error_text end |
#ip ⇒ Object
IP address of user
14 15 16 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 14 def ip @ip end |
#method ⇒ Object
HTTP Method
20 21 22 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 20 def method @method end |
#parameters ⇒ Object
Parameters to the action
24 25 26 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 24 def parameters @parameters end |
#processed ⇒ Object
whether or not is has already been processed by #SlowActions
34 35 36 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 34 def processed @processed end |
#rendering ⇒ Object
time spent rendering
28 29 30 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 28 def rendering @rendering end |
#session ⇒ Object
Session ID
22 23 24 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 22 def session @session end |
#time ⇒ Object
time
18 19 20 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 18 def time @time end |
Instance Method Details
#error? ⇒ Boolean
Whether or not this #LogEntry was an error
37 38 39 40 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 37 def error? return false if error_text.nil? or error_text.empty? return true end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/slow_actions/slow_actions_log_entry.rb', line 42 def to_s "#{date} #{time} #{method} #{controller}##{action} #{parameters}" end |