Class: Leafy::Metrics::Graphite
- Inherits:
-
Object
- Object
- Leafy::Metrics::Graphite
- Defined in:
- lib/leafy/metrics/graphite/graphite.rb
Instance Attribute Summary collapse
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
Class Method Summary collapse
- .new_pickled(hostname, port, batchsize) ⇒ Object
- .new_tcp(hostname, port) ⇒ Object
- .new_udp(hostname, port) ⇒ Object
Instance Method Summary collapse
-
#initialize(sender) ⇒ Graphite
constructor
A new instance of Graphite.
Constructor Details
#initialize(sender) ⇒ Graphite
Returns a new instance of Graphite.
7 8 9 10 11 12 |
# File 'lib/leafy/metrics/graphite/graphite.rb', line 7 def initialize( sender ) unless sender.java_kind_of? Java::ComCodahaleMetricsGraphite::GraphiteSender raise "not instance of 'Java::ComCodahaleMetricsGraphite::Graphite'" end @sender = sender end |
Instance Attribute Details
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
5 6 7 |
# File 'lib/leafy/metrics/graphite/graphite.rb', line 5 def sender @sender end |
Class Method Details
.new_pickled(hostname, port, batchsize) ⇒ Object
22 23 24 |
# File 'lib/leafy/metrics/graphite/graphite.rb', line 22 def self.new_pickled( hostname, port, batchsize ) new com.codahale.metrics.graphite.PickledGraphite.new( hostname, port, batchsize ) end |
.new_tcp(hostname, port) ⇒ Object
14 15 16 |
# File 'lib/leafy/metrics/graphite/graphite.rb', line 14 def self.new_tcp( hostname, port ) new com.codahale.metrics.graphite.Graphite.new( hostname, port ) end |
.new_udp(hostname, port) ⇒ Object
18 19 20 |
# File 'lib/leafy/metrics/graphite/graphite.rb', line 18 def self.new_udp( hostname, port ) new com.codahale.metrics.graphite.GraphiteUDP.new( hostname, port ) end |