Module: Roda::EnhancedLogger::Current
Overview
Data collection for request in current thread
Instance Method Summary collapse
-
#accrued_database_time ⇒ Numeric
The accrued database time.
-
#accrued_database_time=(value) ⇒ Numeric
Set accrued database time.
- #database_query_count ⇒ Object
- #database_query_count=(value) ⇒ Object
-
#increment_accrued_database_time(value) ⇒ Numeric
Increment the accrued database time.
- #increment_database_query_count(value = 1) ⇒ Object
-
#reset ⇒ Object
Reset the counters.
Instance Method Details
#accrued_database_time ⇒ Numeric
The accrued database time
24 25 26 |
# File 'lib/roda/enhanced_logger/current.rb', line 24 def accrued_database_time Thread.current[:accrued_database_time] end |
#accrued_database_time=(value) ⇒ Numeric
Set accrued database time
33 34 35 |
# File 'lib/roda/enhanced_logger/current.rb', line 33 def accrued_database_time=(value) Thread.current[:accrued_database_time] = value end |
#database_query_count ⇒ Object
42 43 44 |
# File 'lib/roda/enhanced_logger/current.rb', line 42 def database_query_count Thread.current[:database_query_count] end |
#database_query_count=(value) ⇒ Object
46 47 48 |
# File 'lib/roda/enhanced_logger/current.rb', line 46 def database_query_count=(value) Thread.current[:database_query_count] = value end |
#increment_accrued_database_time(value) ⇒ Numeric
Increment the accrued database time
17 18 19 20 |
# File 'lib/roda/enhanced_logger/current.rb', line 17 def increment_accrued_database_time(value) Thread.current[:accrued_database_time] ||= 0 Thread.current[:accrued_database_time] += value end |
#increment_database_query_count(value = 1) ⇒ Object
37 38 39 40 |
# File 'lib/roda/enhanced_logger/current.rb', line 37 def increment_database_query_count(value = 1) Thread.current[:database_query_count] ||= 0 Thread.current[:database_query_count] += value end |
#reset ⇒ Object
Reset the counters
51 52 53 54 55 |
# File 'lib/roda/enhanced_logger/current.rb', line 51 def reset self.accrued_database_time = nil self.database_query_count = nil true end |