Module: HostedGraphite

Extended by:
Forwardable, HostedGraphite
Included in:
HostedGraphite
Defined in:
lib/hosted_graphite/http.rb,
lib/hosted_graphite.rb,
lib/hosted_graphite/tcp.rb,
lib/hosted_graphite/udp.rb,
lib/hosted_graphite/statsd.rb,
lib/hosted_graphite/testing.rb,
lib/hosted_graphite/version.rb,
lib/hosted_graphite/protocol.rb,
lib/hosted_graphite/ext/sidekiq.rb

Overview

ANALYSE, is this implementation thread safe ?

Defined Under Namespace

Modules: Ext Classes: HTTP, MissingAPIKey, Protocol, StatsD, TCP, UDP

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.send_metricObject

.testingObject Also known as: increment, decrement, count, gauge, set, timing, time



17
18
19
# File 'lib/hosted_graphite/testing.rb', line 17

def testing(*)
  yield if block_given?
end

Instance Method Details

#api_keyObject



22
23
24
# File 'lib/hosted_graphite.rb', line 22

def api_key
  @api_key ||= ENV['HOSTEDGRAPHITE_APIKEY']
end

#api_key=(key) ⇒ Object



26
27
28
# File 'lib/hosted_graphite.rb', line 26

def api_key=(key)
  @api_key = key
end

#protocolObject



30
31
32
# File 'lib/hosted_graphite.rb', line 30

def protocol
  @protocol
end

#protocol=(protocol) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/hosted_graphite.rb', line 34

def protocol=(protocol)
  case protocol
    when Class
      @protocol = protocol.new
    when String, Symbol
      protocol   = protocol.to_s.upcase
      @protocol = const_get(protocol).new
  end
end

#statsdObject



29
30
31
# File 'lib/hosted_graphite/statsd.rb', line 29

def statsd
  @statsd ||= StatsD.new
end