newrelic-sidekiq-metrics 1.1.1 → 1.4.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: 918e652a40fcca747e0bfbf22ceee1e5f1c1bd84f1977f936ebdc547d56072c6
4
- data.tar.gz: 11c8b9b6cbe94ee53f5aab9f8a6ad3aa06d5963453e166ae4713cd4d78c1e037
3
+ metadata.gz: 8241f2e8c3b2a0d51b0f3c2ee4d775d965fe312969cd16e68e5bca92e122b581
4
+ data.tar.gz: f80777abee0e57d21a9b46611d1dfe70cdb53547f5809ceeaf778141d8fa825e
5
5
  SHA512:
6
- metadata.gz: 2f037664b66be444cd1e93be897ca86181cd0227ef5e2779ce9e7f2578b02641666e534ddf2c4aebfcbcf36a4498cd5096241be49960182a4317ce3257c57a5b
7
- data.tar.gz: 338bfce14a6f9768381f8e0ca6c42b27981120892e399404822e8957fc769e500d79190d115205de0d86bf709b2ebd33a6ef26ba66ce92ab4122a94efbdbbde3
6
+ metadata.gz: d2a7f812fe6ab9cfb45aea9a3dd734a643839c9408890ccb27be47f3ffaff8e981d91abd283afbd548573c35b1b372ba58e556bc4462ea047544f14d038ebf74
7
+ data.tar.gz: 2d95ef05eab5fbe23271613074b16300ed17d3a081b9e764716ec68bd3c647451f748ca4d4cc32348adef36756e15ca758fe5e6bcfc0666d4cf051ab2341994b
data/.bundler-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.32
@@ -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
@@ -10,7 +10,7 @@ jobs:
10
10
  auto-approve:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: hmarr/auto-approve-action@v2.0.0
14
- if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
13
+ - uses: hmarr/auto-approve-action@v2
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: Ruby 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,72 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- newrelic-sidekiq-metrics (1.1.1)
5
- newrelic_rpm (~> 6.8)
6
- sidekiq (~> 6.1)
4
+ newrelic-sidekiq-metrics (1.4.1)
5
+ newrelic_rpm (~> 8)
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 (8.1.0)
17
+ parallel (1.21.0)
18
+ parser (3.0.2.0)
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.6)
26
+ redis (4.5.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.90.0)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-support (3.10.3)
42
+ rubocop (1.23.0)
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.3.0, < 1.0)
48
+ rubocop-ast (>= 1.12.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.43.2)
56
- rubocop (~> 0.87)
57
- ruby-progressbar (1.10.1)
58
- sidekiq (6.1.1)
50
+ unicode-display_width (>= 1.4.0, < 3.0)
51
+ rubocop-ast (1.13.0)
52
+ parser (>= 3.0.1.1)
53
+ rubocop-rake (0.6.0)
54
+ rubocop (~> 1.0)
55
+ rubocop-rspec (2.6.0)
56
+ rubocop (~> 1.19)
57
+ ruby-progressbar (1.11.0)
58
+ sidekiq (6.3.1)
59
59
  connection_pool (>= 2.2.2)
60
60
  rack (~> 2.0)
61
61
  redis (>= 4.2.0)
62
- unicode-display_width (1.7.0)
62
+ unicode-display_width (2.1.0)
63
63
 
64
64
  PLATFORMS
65
- ruby
65
+ aarch64-linux-musl
66
+ x86_64-darwin-18
67
+ x86_64-darwin-19
68
+ x86_64-darwin-20
69
+ x86_64-linux
66
70
 
67
71
  DEPENDENCIES
68
72
  bundler
@@ -71,8 +75,8 @@ DEPENDENCIES
71
75
  rake
72
76
  rspec
73
77
  rubocop
74
- rubocop-performance
78
+ rubocop-rake
75
79
  rubocop-rspec
76
80
 
77
81
  BUNDLED WITH
78
- 2.1.4
82
+ 2.2.29
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/newrelic-sidekiq-metrics.svg)](https://rubygems.org/gems/newrelic-sidekiq-metrics)
2
- [![Build Status](https://travis-ci.org/RenoFi/newrelic-sidekiq-metrics.svg?branch=master)](https://travis-ci.org/RenoFi/newrelic-sidekiq-metrics)
2
+ [![Build Status](https://github.com/RenoFi/newrelic-sidekiq-metrics/actions/workflows/ci.yml/badge.svg)](https://github.com/RenoFi/newrelic-sidekiq-metrics/actions/workflows/ci.yml?query=branch%3Amain)
3
3
 
4
4
  # newrelic-sidekiq-metrics
5
5
 
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]
@@ -10,14 +10,20 @@ 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
+
22
+ stats.public_send(name)
23
+ end
18
24
 
19
25
  def record_metric(name)
20
- NewRelic::Agent.record_metric(metric_full_name(name), stats.public_send(name))
26
+ NewRelic::Agent.record_metric(metric_full_name(name), get_stat(name))
21
27
  end
22
28
 
23
29
  def metric_full_name(name)
@@ -1,3 +1,3 @@
1
1
  module NewrelicSidekiqMetrics
2
- VERSION = "1.1.1".freeze
2
+ VERSION = "1.4.1".freeze
3
3
  end
@@ -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
@@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
14
14
 
15
15
  spec.metadata['homepage_uri'] = 'https://github.com/RenoFi/newrelic-sidekiq-metrics'
16
16
  spec.metadata['source_code_uri'] = 'https://github.com/RenoFi/newrelic-sidekiq-metrics'
17
+ spec.metadata['rubygems_mfa_required'] = 'true'
17
18
 
18
19
  spec.files = Dir.chdir(__dir__) do
19
20
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin/|spec/|\.rub)}) }
@@ -24,14 +25,14 @@ Gem::Specification.new do |spec|
24
25
 
25
26
  spec.required_ruby_version = '>= 2.6'
26
27
 
27
- spec.add_dependency 'newrelic_rpm', '~> 6.8'
28
- spec.add_dependency 'sidekiq', '~> 6.1'
28
+ spec.add_dependency 'newrelic_rpm', '~> 8'
29
+ spec.add_dependency 'sidekiq', '~> 6.2'
29
30
 
30
31
  spec.add_development_dependency 'bundler'
31
32
  spec.add_development_dependency 'pry'
32
33
  spec.add_development_dependency 'rake'
33
34
  spec.add_development_dependency 'rspec'
34
35
  spec.add_development_dependency 'rubocop'
35
- spec.add_development_dependency 'rubocop-performance'
36
+ spec.add_development_dependency 'rubocop-rake'
36
37
  spec.add_development_dependency 'rubocop-rspec'
37
38
  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.1
4
+ version: 1.4.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-09-02 00:00:00.000000000 Z
12
+ date: 2021-11-24 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: '8'
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: '8'
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
@@ -171,6 +173,7 @@ licenses:
171
173
  metadata:
172
174
  homepage_uri: https://github.com/RenoFi/newrelic-sidekiq-metrics
173
175
  source_code_uri: https://github.com/RenoFi/newrelic-sidekiq-metrics
176
+ rubygems_mfa_required: 'true'
174
177
  post_install_message:
175
178
  rdoc_options: []
176
179
  require_paths:
@@ -186,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
189
  - !ruby/object:Gem::Version
187
190
  version: '0'
188
191
  requirements: []
189
- rubygems_version: 3.1.2
192
+ rubygems_version: 3.2.23
190
193
  signing_key:
191
194
  specification_version: 4
192
195
  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