Class: Flipper::Instrumentation::StatsdSubscriber
- Inherits:
-
Subscriber
- Object
- Subscriber
- Flipper::Instrumentation::StatsdSubscriber
- Defined in:
- lib/flipper/instrumentation/statsd_subscriber.rb
Constant Summary
Constants inherited from Subscriber
Flipper::Instrumentation::Subscriber::QUESTION_MARK
Class Attribute Summary collapse
-
.client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
Methods inherited from Subscriber
call, #initialize, #strip_trailing_question_mark, #update, #update_adapter_operation_metrics, #update_feature_operation_metrics, #update_poller_metrics, #update_synchronizer_call_metrics
Constructor Details
This class inherits a constructor from Flipper::Instrumentation::Subscriber
Class Attribute Details
.client ⇒ Object
Returns the value of attribute client.
11 12 13 |
# File 'lib/flipper/instrumentation/statsd_subscriber.rb', line 11 def client @client end |
Instance Method Details
#update_counter(metric) ⇒ Object
18 19 20 |
# File 'lib/flipper/instrumentation/statsd_subscriber.rb', line 18 def update_counter(metric) self.class.client&.increment metric end |
#update_timer(metric) ⇒ Object
14 15 16 |
# File 'lib/flipper/instrumentation/statsd_subscriber.rb', line 14 def update_timer(metric) self.class.client&.timing metric, (@duration * 1_000).round end |