Skip to content

Commit

Permalink
Merge pull request #283 from seomoz/maura/remove-metriks
Browse files Browse the repository at this point in the history
Remove uses of metriks and its dependencies.
  • Loading branch information
sistawendy authored Jul 21, 2020
2 parents 08e16c2 + 2ed0a21 commit 7ac9f3a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 109 deletions.
8 changes: 0 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PATH
remote: .
specs:
qless (0.11.0)
metriks (~> 0.9)
redis (>= 2.2, < 4.0.0.rc1)
rusage (~> 0.2.0)
sentry-raven (~> 0.15.6)
Expand All @@ -16,9 +15,6 @@ GEM
remote: http://rubygems.org/
specs:
ast (2.3.0)
atomic (1.1.99)
avl_tree (1.2.1)
atomic (~> 1.1)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
byebug (2.7.0)
Expand Down Expand Up @@ -55,10 +51,6 @@ GEM
hitimes (1.2.6)
http_parser.rb (0.5.3)
method_source (0.8.2)
metriks (0.9.9.8)
atomic (~> 1.0)
avl_tree (~> 1.2.0)
hitimes (~> 1.1)
mime-types (1.25)
mini_portile (0.5.1)
multi_json (1.12.2)
Expand Down
12 changes: 3 additions & 9 deletions lib/qless/middleware/metriks.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Encoding: utf-8

require 'metriks'
# This middleware is now a no-op because
# the metriks dependency breaks builds.

module Qless
module Middleware
Expand All @@ -9,9 +10,7 @@ module Metriks
# Tracks the time jobs take, grouping the timings by the job class.
module TimeJobsByClass
def around_perform(job)
::Metriks.timer("qless.job-times.#{job.klass_name}").time do
super
end
super
end
end

Expand All @@ -31,11 +30,6 @@ def initialize(class_to_event_map)
module_eval do # eval the block within the module instance
define_method :around_perform do |job|
super(job)
return unless job.state == 'complete'
return unless event_name = class_to_event_map[job.klass]

counter = ::Metriks.counter("qless.job-events.#{event_name}")
counter.increment
end
end
end
Expand Down
1 change: 0 additions & 1 deletion qless.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ language-specific extension will also remain up to date.
s.test_files = s.files.grep(/^(test|spec|features)\//)
s.require_paths = ['lib']

s.add_dependency 'metriks', '~> 0.9'
s.add_dependency 'redis', ['>= 2.2', '< 4.0.0.rc1']
s.add_dependency 'rusage', '~> 0.2.0'
s.add_dependency 'sentry-raven', '~> 0.15.6'
Expand Down
91 changes: 0 additions & 91 deletions spec/unit/middleware/metriks_spec.rb

This file was deleted.

0 comments on commit 7ac9f3a

Please sign in to comment.