Permalink
Browse files

Merge pull request #291 from igorbozato/remove_metriks_support

Remove metriks support
  • Loading branch information...
2 parents 809294b + 1e7fae6 commit c4a21569b223aab17e9b5f2e4d9ef36164e4d4c8 @jnunemaker committed on GitHub Sep 26, 2017
View
@@ -8,7 +8,6 @@ end
gem 'pry'
gem 'rake', '~> 10.4.2'
-gem 'metriks', '~> 0.9.9'
gem 'shotgun', '~> 0.9'
gem 'statsd-ruby', '~> 1.2.1'
gem 'rspec', '~> 3.0'
View
@@ -77,7 +77,7 @@ Of course there are more [examples for you to peruse](examples/). You could also
* [Gates](docs/Gates.md) - Boolean, Groups, Actors, % of Actors, and % of Time
* [Adapters](docs/Adapters.md) - Mongo, Redis, Cassandra, Active Record...
-* [Instrumentation](docs/Instrumentation.md) - ActiveSupport::Notifications, Statsd and Metriks
+* [Instrumentation](docs/Instrumentation.md) - ActiveSupport::Notifications and Statsd
* [Optimization](docs/Optimization.md) - Memoization middleware and Cache adapters
* [Web Interface](docs/ui/README.md) - Point and click...
* [API](docs/api/README.md) - HTTP API interface
@@ -1,6 +0,0 @@
-require 'securerandom'
-require 'active_support/notifications'
-require 'flipper/instrumentation/metriks_subscriber'
-
-ActiveSupport::Notifications.subscribe /\.flipper$/,
- Flipper::Instrumentation::MetriksSubscriber
@@ -1,20 +0,0 @@
-# Note: You should never need to require this file directly if you are using
-# ActiveSupport::Notifications. Instead, you should require the metriks file
-# that lives in the same directory as this file. The benefit is that it
-# subscribes to the correct events and does everything for your.
-require 'flipper/instrumentation/subscriber'
-require 'metriks'
-
-module Flipper
- module Instrumentation
- class MetriksSubscriber < Subscriber
- def update_timer(metric)
- Metriks.timer(metric).update(@duration)
- end
-
- def update_counter(metric)
- Metriks.meter(metric).mark
- end
- end
- end
-end
@@ -1,52 +0,0 @@
-require 'helper'
-require 'flipper/adapters/memory'
-require 'flipper/instrumentation/metriks'
-
-RSpec.describe Flipper::Instrumentation::MetriksSubscriber do
- let(:adapter) do
- memory = Flipper::Adapters::Memory.new
- Flipper::Adapters::Instrumented.new(memory, instrumenter: ActiveSupport::Notifications)
- end
- let(:flipper) do
- Flipper.new(adapter, instrumenter: ActiveSupport::Notifications)
- end
-
- let(:user) { user = Flipper::Actor.new('1') }
-
- before do
- Metriks::Registry.default.clear
- end
-
- context 'for enabled feature' do
- it 'updates feature metrics when calls happen' do
- flipper[:stats].enable(user)
- expect(Metriks.timer('flipper.feature_operation.enable').count).to be(1)
-
- flipper[:stats].enabled?(user)
- expect(Metriks.timer('flipper.feature_operation.enabled').count).to be(1)
- expect(Metriks.meter('flipper.feature.stats.enabled').count).to be(1)
- end
- end
-
- context 'for disabled feature' do
- it 'updates feature metrics when calls happen' do
- flipper[:stats].disable(user)
- expect(Metriks.timer('flipper.feature_operation.disable').count).to be(1)
-
- flipper[:stats].enabled?(user)
- expect(Metriks.timer('flipper.feature_operation.enabled').count).to be(1)
- expect(Metriks.meter('flipper.feature.stats.disabled').count).to be(1)
- end
- end
-
- it 'updates adapter metrics when calls happen' do
- flipper[:stats].enable(user)
- expect(Metriks.timer('flipper.adapter.memory.enable').count).to be(1)
-
- flipper[:stats].enabled?(user)
- expect(Metriks.timer('flipper.adapter.memory.get').count).to be(1)
-
- flipper[:stats].disable(user)
- expect(Metriks.timer('flipper.adapter.memory.disable').count).to be(1)
- end
-end

0 comments on commit c4a2156

Please sign in to comment.