lib/flipper/instrumentation/subscriber.rb in flipper-0.10.2 vs lib/flipper/instrumentation/subscriber.rb in flipper-0.11.0.beta1

- old
+ new

@@ -15,16 +15,16 @@ @duration = ending - start @transaction_id = transaction_id end # Internal: Override in subclass. - def update_timer(metric) + def update_timer(_metric) raise 'not implemented' end # Internal: Override in subclass. - def update_counter(metric) + def update_counter(_metric) raise 'not implemented' end # Private def update @@ -32,11 +32,12 @@ method_name = "update_#{operation_type}_metrics" if respond_to?(method_name) send(method_name) else - puts "Could not update #{operation_type} metrics as #{self.class} did not respond to `#{method_name}`" + puts "Could not update #{operation_type} metrics as #{self.class} " \ + "did not respond to `#{method_name}`" end end # Private def update_feature_operation_metrics @@ -47,15 +48,16 @@ thing = @payload[:thing] update_timer "flipper.feature_operation.#{operation}" if @payload[:operation] == :enabled? - metric_name = if result - "flipper.feature.#{feature_name}.enabled" - else - "flipper.feature.#{feature_name}.disabled" - end + metric_name = + if result + "flipper.feature.#{feature_name}.enabled" + else + "flipper.feature.#{feature_name}.disabled" + end update_counter metric_name end end @@ -65,14 +67,13 @@ operation = @payload[:operation] result = @payload[:result] value = @payload[:value] key = @payload[:key] - update_timer "flipper.adapter.#{adapter_name}.#{operation}" end - QUESTION_MARK = "?".freeze + QUESTION_MARK = '?'.freeze # Private def strip_trailing_question_mark(operation) operation.to_s.chomp(QUESTION_MARK) end