Class: StatsWhisper::Backend::Logger
- Inherits:
-
Object
- Object
- StatsWhisper::Backend::Logger
- Defined in:
- lib/stats_whisper/backend/logger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #collect_metric(metric) ⇒ Object (also: #increment)
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #timing(path, timestamp) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
7 8 9 |
# File 'lib/stats_whisper/backend/logger.rb', line 7 def initialize @logger = StatsWhisper.logger end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/stats_whisper/backend/logger.rb', line 5 def logger @logger end |
Instance Method Details
#collect_metric(metric) ⇒ Object Also known as: increment
15 16 17 |
# File 'lib/stats_whisper/backend/logger.rb', line 15 def collect_metric(metric) StatsWhisper.logger.info "[StatsWhisper] #{metric}" end |
#timing(path, timestamp) ⇒ Object
11 12 13 |
# File 'lib/stats_whisper/backend/logger.rb', line 11 def timing(path, ) collect_metric("#{path}:#{}") end |