Class: Garelic::Metrics
- Inherits:
-
Object
- Object
- Garelic::Metrics
- Defined in:
- lib/garelic.rb
Class Method Summary collapse
- .[](category) ⇒ Object
- .action_identifier ⇒ Object
- .action_identifier=(value) ⇒ Object
- .report(category, variable, runtime, payload = nil) ⇒ Object
- .reset! ⇒ Object
Class Method Details
.[](category) ⇒ Object
113 114 115 |
# File 'lib/garelic.rb', line 113 def self.[](category) metrics[category] || {} end |
.action_identifier ⇒ Object
104 105 106 |
# File 'lib/garelic.rb', line 104 def self.action_identifier Thread.current[:garelic_action] end |
.action_identifier=(value) ⇒ Object
100 101 102 |
# File 'lib/garelic.rb', line 100 def self.action_identifier=(value) Thread.current[:garelic_action] = value end |
.report(category, variable, runtime, payload = nil) ⇒ Object
108 109 110 111 |
# File 'lib/garelic.rb', line 108 def self.report(category, variable, runtime, payload = nil) metrics[category] ||= Hash.new(0) metrics[category][variable] += runtime end |
.reset! ⇒ Object
95 96 97 98 |
# File 'lib/garelic.rb', line 95 def self.reset! Thread.current[:garelic] = {} Thread.current[:garelic_action] = nil end |