Class: Leafy::Metrics::GraphiteReporter::Builder

Inherits:
Reporter::Builder show all
Defined in:
lib/leafy/metrics/graphite/graphite_reporter.rb

Instance Method Summary collapse

Methods inherited from Reporter::Builder

#convert_durations_to, #convert_rates_to

Constructor Details

#initialize(metrics) ⇒ Builder

Returns a new instance of Builder.



11
12
13
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 11

def initialize( metrics )
  super( ::GraphiteReporter, metrics )
end

Instance Method Details

#build(graphite) ⇒ Object



20
21
22
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 20

def build( graphite )
  Reporter.new( @builder.build( graphite.sender ) )
end

#build_pickled(host, port) ⇒ Object



32
33
34
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 32

def build_pickled( host, port )
  build( Leafy::Metrics::Graphite.new_pickled( host, port ) )
end

#build_tcp(host, port) ⇒ Object



24
25
26
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 24

def build_tcp( host, port )
  build( Leafy::Metrics::Graphite.new_tcp( host, port ) )
end

#build_udp(host, port) ⇒ Object



28
29
30
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 28

def build_udp( host, port )
  build( Leafy::Metrics::Graphite.new_udp( host, port ) )
end

#prefixed_with(prefix) ⇒ Object



15
16
17
18
# File 'lib/leafy/metrics/graphite/graphite_reporter.rb', line 15

def prefixed_with( prefix )
  @builder.prefixed_with( prefix )
  self
end