Class: StatsdHelper
- Inherits:
-
Object
- Object
- StatsdHelper
- Defined in:
- lib/resque-statsd.rb
Class Method Summary collapse
- .graphite_host ⇒ Object
- .graphite_host=(val) ⇒ Object
- .graphite_port ⇒ Object
- .graphite_port=(val) ⇒ Object
- .namespace ⇒ Object
- .namespace=(val) ⇒ Object
-
.statsd ⇒ Object
Set up the client lazily, to minimize order-of-operations headaches.
Class Method Details
.graphite_host ⇒ Object
6 7 8 |
# File 'lib/resque-statsd.rb', line 6 def self.graphite_host return @graphite_host || ENV['GRAPHITE_HOST'] || 'localhost' end |
.graphite_host=(val) ⇒ Object
9 10 11 |
# File 'lib/resque-statsd.rb', line 9 def self.graphite_host=(val) @graphite_host = val end |
.graphite_port ⇒ Object
13 14 15 |
# File 'lib/resque-statsd.rb', line 13 def self.graphite_port return @graphite_port || ENV['GRAPHITE_PORT'] || 8125 end |
.graphite_port=(val) ⇒ Object
16 17 18 |
# File 'lib/resque-statsd.rb', line 16 def self.graphite_port=(val) @graphite_port = val end |
.namespace ⇒ Object
20 21 22 |
# File 'lib/resque-statsd.rb', line 20 def self.namespace return @namespace || ENV['GRAPHITE_NAMESPACE'] || 'resque' end |
.namespace=(val) ⇒ Object
23 24 25 |
# File 'lib/resque-statsd.rb', line 23 def self.namespace=(val) @namespace = val end |
.statsd ⇒ Object
Set up the client lazily, to minimize order-of-operations headaches.
28 29 30 31 32 33 34 |
# File 'lib/resque-statsd.rb', line 28 def self.statsd if(@stats.nil?) @statsd = Statsd.new(graphite_host, graphite_port) @statsd.namespace = namespace end return @statsd end |