Class: Yabeda::Statsd::Adapter
- Inherits:
-
BaseAdapter
- Object
- BaseAdapter
- Yabeda::Statsd::Adapter
- Defined in:
- lib/yabeda/statsd/adapter.rb
Overview
Adapter for statsd
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(connection:) ⇒ Adapter
constructor
A new instance of Adapter.
- #perform_counter_increment!(counter, tags, increment) ⇒ Object
- #perform_gauge_set!(gauge, tags, value) ⇒ Object
- #perform_histogram_measure!(historam, tags, value) ⇒ Object
- #register_counter!(_) ⇒ Object
- #register_gauge!(_) ⇒ Object
- #register_histogram!(_) ⇒ Object
Constructor Details
#initialize(connection:) ⇒ Adapter
Returns a new instance of Adapter.
12 13 14 |
# File 'lib/yabeda/statsd/adapter.rb', line 12 def initialize(connection:) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
10 11 12 |
# File 'lib/yabeda/statsd/adapter.rb', line 10 def connection @connection end |
Instance Method Details
#perform_counter_increment!(counter, tags, increment) ⇒ Object
20 21 22 23 |
# File 'lib/yabeda/statsd/adapter.rb', line 20 def perform_counter_increment!(counter, , increment) = Yabeda::Statsd::Tags.build() connection.increment(build_name(counter), by: increment, tags: ) end |
#perform_gauge_set!(gauge, tags, value) ⇒ Object
29 30 31 32 |
# File 'lib/yabeda/statsd/adapter.rb', line 29 def perform_gauge_set!(gauge, , value) = Yabeda::Statsd::Tags.build() connection.gauge(build_name(gauge), value, tags: ) end |
#perform_histogram_measure!(historam, tags, value) ⇒ Object
38 39 40 41 |
# File 'lib/yabeda/statsd/adapter.rb', line 38 def perform_histogram_measure!(historam, , value) = Yabeda::Statsd::Tags.build() connection.histogram(build_name(historam), value, tags: ) end |
#register_counter!(_) ⇒ Object
16 17 18 |
# File 'lib/yabeda/statsd/adapter.rb', line 16 def register_counter!(_) # We don't need to register metric end |
#register_gauge!(_) ⇒ Object
25 26 27 |
# File 'lib/yabeda/statsd/adapter.rb', line 25 def register_gauge!(_) # We don't need to register metric end |
#register_histogram!(_) ⇒ Object
34 35 36 |
# File 'lib/yabeda/statsd/adapter.rb', line 34 def register_histogram!(_) # We don't need to register metric end |