newrelic-sidekiq-metrics 1.1.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e79240e42709d193295947a6b3ed604205ce0f5ae07ec3f5f68f1f3787101b30
4
- data.tar.gz: 78b74fb7c189176bfa6da189102ae1748e79ad2a8379ab74fcb4b2413d083e1e
3
+ metadata.gz: a27a079527d1d5a2fee926474b303b3873c731549ea9424be3c9084be0ced70f
4
+ data.tar.gz: 1f21921a65d2e041ce3b9037434989d928580f2a2c3e9c5d33fa6933fc46bd82
5
5
  SHA512:
6
- metadata.gz: e4b1fea20dae6f7a83222c912d2cfa754721b76e2b3a7e450ef79c9d15afda27c287fa0f2447f16fcfab1f591ec024ebf24774ea98b053327850bba98fc14bec
7
- data.tar.gz: 791dafd70e8943fe96624fa172141985c2eefae203fb0d4f72945e500f6caf267dcdc003391c31820a81f7c32bceb760b6899550c231746c2e79ee72a5f578b2
6
+ metadata.gz: d2743eaced2fcc43ea9c9885d65588e39d4d2939e8068506fa4e519bebaa5b408c8275ab06a6e95940882e02925ea5cc62ba92d9af021c647b56e58b3329645d
7
+ data.tar.gz: 6119743f9ca0fbba2afc47d24d5692fbee309218ff0ca5df3e88977d4285f033d3ef2c7d237004a84182380ffbc91d77a633033baba5c2b10ecbdbe351ac0635
data/.bundler-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.22
@@ -3,9 +3,14 @@ version: 1
3
3
  update_configs:
4
4
  - package_manager: "ruby:bundler"
5
5
  directory: "/"
6
- update_schedule: "monthly"
6
+ update_schedule: "daily"
7
7
  commit_message:
8
8
  prefix: "[dependabot]"
9
9
  allowed_updates:
10
10
  - match:
11
- update_type: "all"
11
+ dependency_type: "all"
12
+ update_type: "security"
13
+ automerged_updates:
14
+ - match:
15
+ dependency_type: "all"
16
+ update_type: "security:patch"
@@ -1,18 +1,6 @@
1
- ## Description
1
+ ## Description, motivation and context
2
2
  <!--- Describe your changes in detail -->
3
-
4
- ## Related issue(s)
5
- <!--- GH issue number -->
6
-
7
- ## Motivation and Context
8
3
  <!--- Why is this change required? What problem does it solve? -->
9
- <!--- If it fixes an open issue, please link to the issue here. -->
10
4
 
11
- ## How Has This Been Tested?
12
- <!--- Please describe in detail how you tested your changes. -->
13
-
14
- ## Screenshots (if appropriate):
15
- <!--- Please add any screenshots of the feature. -->
16
-
17
- ## Related PRs
18
- <!--- Please add links to any related PRs (backend, component packages, etc). -->
5
+ ## Related issue(s) or PR(s)
6
+ <!--- GH issue number -->
@@ -1,7 +1,7 @@
1
- # automatically approve PRs submitted by Dependabot
1
+ # automatically approve PRs submitted by Dependabot or Renofidev
2
2
  # this will allow Dependabot to automatically merge dependency update PRs where CI passes
3
3
  # from: https://github.com/hmarr/auto-approve-action
4
- name: Auto approve Dependabot PRs
4
+ name: Auto approve dependency upgrades PRs
5
5
 
6
6
  on:
7
7
  pull_request
@@ -11,6 +11,6 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: hmarr/auto-approve-action@v2.0.0
14
- if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
14
+ if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' || github.actor == 'renofidev'
15
15
  with:
16
16
  github-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -0,0 +1,19 @@
1
+ name: automerge
2
+ on:
3
+ pull_request_review:
4
+ types:
5
+ - submitted
6
+ check_suite:
7
+ types:
8
+ - completed
9
+ status: {}
10
+ jobs:
11
+ automerge:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: automerge
15
+ uses: "pascalgn/automerge-action@v0.12.0"
16
+ env:
17
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18
+ MERGE_METHOD: squash
19
+ MERGE_DELETE_BRANCH: true
@@ -0,0 +1,28 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.7', '3.0']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby
19
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
20
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
21
+ # uses: ruby/setup-ruby@v1
22
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26
+
27
+ - name: Run tests
28
+ run: bundle exec rake ci
data/Gemfile.lock CHANGED
@@ -1,68 +1,70 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- newrelic-sidekiq-metrics (1.1.0)
5
- newrelic_rpm (~> 6.8)
6
- sidekiq (~> 6.1)
4
+ newrelic-sidekiq-metrics (1.3.1)
5
+ newrelic_rpm (~> 7.0)
6
+ sidekiq (~> 6.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.1)
11
+ ast (2.4.2)
12
12
  coderay (1.1.3)
13
- connection_pool (2.2.3)
13
+ connection_pool (2.2.5)
14
14
  diff-lcs (1.4.4)
15
15
  method_source (1.0.0)
16
- newrelic_rpm (6.12.0.367)
17
- parallel (1.19.2)
18
- parser (2.7.1.4)
16
+ newrelic_rpm (7.2.0)
17
+ parallel (1.20.1)
18
+ parser (3.0.1.1)
19
19
  ast (~> 2.4.1)
20
- pry (0.13.1)
20
+ pry (0.14.1)
21
21
  coderay (~> 1.1)
22
22
  method_source (~> 1.0)
23
23
  rack (2.2.3)
24
24
  rainbow (3.0.0)
25
- rake (13.0.1)
26
- redis (4.2.1)
27
- regexp_parser (1.7.1)
28
- rexml (3.2.4)
29
- rspec (3.9.0)
30
- rspec-core (~> 3.9.0)
31
- rspec-expectations (~> 3.9.0)
32
- rspec-mocks (~> 3.9.0)
33
- rspec-core (3.9.2)
34
- rspec-support (~> 3.9.3)
35
- rspec-expectations (3.9.2)
25
+ rake (13.0.4)
26
+ redis (4.3.1)
27
+ regexp_parser (2.1.1)
28
+ rexml (3.2.5)
29
+ rspec (3.10.0)
30
+ rspec-core (~> 3.10.0)
31
+ rspec-expectations (~> 3.10.0)
32
+ rspec-mocks (~> 3.10.0)
33
+ rspec-core (3.10.1)
34
+ rspec-support (~> 3.10.0)
35
+ rspec-expectations (3.10.1)
36
36
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.9.0)
38
- rspec-mocks (3.9.1)
37
+ rspec-support (~> 3.10.0)
38
+ rspec-mocks (3.10.2)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.9.0)
41
- rspec-support (3.9.3)
42
- rubocop (0.89.0)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-support (3.10.2)
42
+ rubocop (1.18.3)
43
43
  parallel (~> 1.10)
44
- parser (>= 2.7.1.1)
44
+ parser (>= 3.0.0.0)
45
45
  rainbow (>= 2.2.2, < 4.0)
46
- regexp_parser (>= 1.7)
46
+ regexp_parser (>= 1.8, < 3.0)
47
47
  rexml
48
- rubocop-ast (>= 0.1.0, < 1.0)
48
+ rubocop-ast (>= 1.7.0, < 2.0)
49
49
  ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 1.4.0, < 2.0)
51
- rubocop-ast (0.3.0)
52
- parser (>= 2.7.1.4)
53
- rubocop-performance (1.7.1)
54
- rubocop (>= 0.82.0)
55
- rubocop-rspec (1.42.0)
56
- rubocop (>= 0.87.0)
57
- ruby-progressbar (1.10.1)
58
- sidekiq (6.1.1)
50
+ unicode-display_width (>= 1.4.0, < 3.0)
51
+ rubocop-ast (1.7.0)
52
+ parser (>= 3.0.1.1)
53
+ rubocop-rake (0.6.0)
54
+ rubocop (~> 1.0)
55
+ rubocop-rspec (2.4.0)
56
+ rubocop (~> 1.0)
57
+ rubocop-ast (>= 1.1.0)
58
+ ruby-progressbar (1.11.0)
59
+ sidekiq (6.2.1)
59
60
  connection_pool (>= 2.2.2)
60
61
  rack (~> 2.0)
61
62
  redis (>= 4.2.0)
62
- unicode-display_width (1.7.0)
63
+ unicode-display_width (2.0.0)
63
64
 
64
65
  PLATFORMS
65
66
  ruby
67
+ x86_64-linux
66
68
 
67
69
  DEPENDENCIES
68
70
  bundler
@@ -71,8 +73,8 @@ DEPENDENCIES
71
73
  rake
72
74
  rspec
73
75
  rubocop
74
- rubocop-performance
76
+ rubocop-rake
75
77
  rubocop-rspec
76
78
 
77
79
  BUNDLED WITH
78
- 2.1.4
80
+ 2.2.15
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
  require 'rubocop/rake_task'
4
- require 'newrelic_sidekiq_metrics'
5
4
 
6
5
  RSpec::Core::RakeTask.new(:spec)
7
6
  RuboCop::RakeTask.new
8
7
 
9
- task default: %w[spec rubocop:auto_correct]
8
+ task ci: %i[spec rubocop]
9
+ task default: %i[spec rubocop:auto_correct]
@@ -50,6 +50,10 @@ module NewrelicSidekiqMetrics
50
50
  end
51
51
  end
52
52
  end
53
+
54
+ def self.inline_sidekiq?
55
+ defined?(Sidekiq::Testing) && Sidekiq::Testing.inline?
56
+ end
53
57
  end
54
58
 
55
59
  NewrelicSidekiqMetrics.add_client_middleware
@@ -10,14 +10,19 @@ module NewrelicSidekiqMetrics
10
10
  metrics.each { |m| record_metric(m) }
11
11
  end
12
12
 
13
+ private
14
+
13
15
  def stats
14
16
  @stats ||= Sidekiq::Stats.new
15
17
  end
16
18
 
17
- private
19
+ def get_stat(name)
20
+ return 0 if NewrelicSidekiqMetrics.inline_sidekiq?
21
+ stats.public_send(name)
22
+ end
18
23
 
19
24
  def record_metric(name)
20
- NewRelic::Agent.record_metric(metric_full_name(name), stats.public_send(name))
25
+ NewRelic::Agent.record_metric(metric_full_name(name), get_stat(name))
21
26
  end
22
27
 
23
28
  def metric_full_name(name)
@@ -1,3 +1,3 @@
1
1
  module NewrelicSidekiqMetrics
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.3.1".freeze
3
3
  end
@@ -24,14 +24,14 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = '>= 2.6'
26
26
 
27
- spec.add_dependency 'newrelic_rpm', '~> 6.8'
28
- spec.add_dependency 'sidekiq', '~> 6.1'
27
+ spec.add_dependency 'newrelic_rpm', '~> 7.0'
28
+ spec.add_dependency 'sidekiq', '~> 6.2'
29
29
 
30
30
  spec.add_development_dependency 'bundler'
31
31
  spec.add_development_dependency 'pry'
32
32
  spec.add_development_dependency 'rake'
33
33
  spec.add_development_dependency 'rspec'
34
34
  spec.add_development_dependency 'rubocop'
35
- spec.add_development_dependency 'rubocop-performance'
35
+ spec.add_development_dependency 'rubocop-rake'
36
36
  spec.add_development_dependency 'rubocop-rspec'
37
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-sidekiq-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-08-10 00:00:00.000000000 Z
12
+ date: 2021-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: newrelic_rpm
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '6.8'
20
+ version: '7.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '6.8'
27
+ version: '7.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: sidekiq
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '6.1'
34
+ version: '6.2'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '6.1'
41
+ version: '6.2'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
- name: rubocop-performance
113
+ name: rubocop-rake
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
@@ -145,15 +145,17 @@ executables: []
145
145
  extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
148
+ - ".bundler-version"
148
149
  - ".dependabot/config.yml"
149
150
  - ".github/ISSUE_TEMPLATE/bug_report.md"
150
151
  - ".github/ISSUE_TEMPLATE/config.yml"
151
152
  - ".github/ISSUE_TEMPLATE/story.md"
152
153
  - ".github/PULL_REQUEST_TEMPLATE.md"
153
154
  - ".github/workflows/auto-approve.yml"
155
+ - ".github/workflows/auto-merge.yml"
156
+ - ".github/workflows/ci.yml"
154
157
  - ".gitignore"
155
158
  - ".rspec"
156
- - ".travis.yml"
157
159
  - Gemfile
158
160
  - Gemfile.lock
159
161
  - LICENSE
@@ -186,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
188
  - !ruby/object:Gem::Version
187
189
  version: '0'
188
190
  requirements: []
189
- rubygems_version: 3.1.2
191
+ rubygems_version: 3.2.15
190
192
  signing_key:
191
193
  specification_version: 4
192
194
  summary: Implements recording Sidekiq stats to New Relic metrics.
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6
7
- - 2.7
8
- before_install: gem install bundler
9
- script:
10
- - bundle exec rake rubocop
11
- - bundle exec rake spec
12
- services:
13
- - redis-server