puma-metrics 1.2.1 → 1.2.4

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: 7c27f15c1dd3aff32b53bfa540b7ba9b8f8f2d019e3142caf1eac4e80c451f69
4
- data.tar.gz: 5cd3ea68ac8bf3c641c7d235a75425b9fa7c701c4b65f6b39a68a5a4dc71c293
3
+ metadata.gz: ca04f9fbdb4d46c6d48039194b6df316412399347e295baa0b7ffa6d58fbf70e
4
+ data.tar.gz: 169662435570a490c711292deff5f9ae6d475a5a9cb6fd90945949e47ace16b9
5
5
  SHA512:
6
- metadata.gz: b413c77b97c65017fe216e5b55d73671c13b8fa5b8d94a11e9d7514d0828b0d3f61c489f7d185d225e44048d1001ed0cf58f0e108b86bef7f3ff5c0ec0064a62
7
- data.tar.gz: 2c496212669c58fbcdc90688e8c852dba1375bd89a956466ca8c882addffaaa1613fadc3632dd2e42b3cf7ce9240a6147366482774fe8a7a1fdfda41b10844c2
6
+ metadata.gz: e1f361d5271ae1906dcf4c9235522b2059716ccce8317bece35de23c7ca41aa68eac9cfeb1af2c0148a386d09e8841b02a0b3f93a9837138cea6d77b62404b38
7
+ data.tar.gz: 0ee3cce82e4482b9ab79cef06ecec083314e50456138949afb7faa464735a68968943f281d45c38a585f7cbda3ff9612aa10c31e0f1b4e3dc434f4eefecc86fe
@@ -6,7 +6,7 @@ jobs:
6
6
  runs-on: ubuntu-latest
7
7
  steps:
8
8
  - uses: actions/checkout@master
9
- - uses: actions/setup-ruby@master
9
+ - uses: ruby/setup-ruby@master
10
10
  with:
11
11
  ruby-version: ${{ matrix.ruby }}
12
12
  - run: gem install bundler
@@ -19,7 +19,7 @@ jobs:
19
19
  run: bundle exec overcommit --run
20
20
  strategy:
21
21
  matrix:
22
- ruby: ['2.6', '2.7', '3.0']
22
+ ruby: ['2.6', '2.7', '3.0', '3.1']
23
23
  deploy:
24
24
  if: github.ref == 'refs/heads/master'
25
25
  name: to rubygems
@@ -27,9 +27,9 @@ jobs:
27
27
  runs-on: ubuntu-latest
28
28
  steps:
29
29
  - uses: actions/checkout@master
30
- - uses: actions/setup-ruby@master
30
+ - uses: ruby/setup-ruby@master
31
31
  with:
32
- ruby-version: 3.0
32
+ ruby-version: 3.1
33
33
  - env:
34
34
  RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
35
35
  run: |
data/.rubocop.yml CHANGED
@@ -1,6 +1,10 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  TargetRubyVersion: 2.6
3
4
 
5
+ Gemspec/RequireMFA:
6
+ Enabled: false
7
+
4
8
  Naming/FileName:
5
9
  Exclude:
6
10
  - puma-metrics.gemspec
data/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.2.4
6
+
7
+ Changes:
8
+ - Shut down metrics server in `on_stopped` so it only stops when main puma process stops and ignores when workers are
9
+ stopped. This allows us to maintain a running metrics server when workers restart or crash.
10
+
11
+ Housekeeping:
12
+ - Update dependencies
13
+ - Test on ruby 3.1
14
+
15
+ ## 1.2.3
16
+
17
+ Housekeeping:
18
+ - Update dependencies
19
+
20
+ ## 1.2.2
21
+
22
+ Changes:
23
+ - Expose new metric `puma_requests_count` when using Puma 5
24
+
5
25
  ## 1.2.1
6
26
 
7
27
  Changes:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puma-metrics (1.2.0)
4
+ puma-metrics (1.2.3)
5
5
  prometheus-client (>= 0.10)
6
6
  puma (>= 3.0)
7
7
 
@@ -9,36 +9,37 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
- childprocess (4.0.0)
12
+ childprocess (4.1.0)
13
13
  iniparse (1.5.0)
14
- minitest (5.14.3)
15
- nio4r (2.5.5)
16
- overcommit (0.57.0)
14
+ minitest (5.15.0)
15
+ nio4r (2.5.8)
16
+ overcommit (0.58.0)
17
17
  childprocess (>= 0.6.3, < 5)
18
18
  iniparse (~> 1.4)
19
- parallel (1.20.1)
20
- parser (3.0.0.0)
19
+ rexml (~> 3.2)
20
+ parallel (1.21.0)
21
+ parser (3.1.1.0)
21
22
  ast (~> 2.4.1)
22
- prometheus-client (2.1.0)
23
- puma (5.2.1)
23
+ prometheus-client (3.0.0)
24
+ puma (5.6.2)
24
25
  nio4r (~> 2.0)
25
- rainbow (3.0.0)
26
- rake (13.0.3)
27
- regexp_parser (2.0.3)
28
- rexml (3.2.4)
29
- rubocop (1.10.0)
26
+ rainbow (3.1.1)
27
+ rake (13.0.6)
28
+ regexp_parser (2.2.1)
29
+ rexml (3.2.5)
30
+ rubocop (1.25.1)
30
31
  parallel (~> 1.10)
31
- parser (>= 3.0.0.0)
32
+ parser (>= 3.1.0.0)
32
33
  rainbow (>= 2.2.2, < 4.0)
33
34
  regexp_parser (>= 1.8, < 3.0)
34
35
  rexml
35
- rubocop-ast (>= 1.2.0, < 2.0)
36
+ rubocop-ast (>= 1.15.1, < 2.0)
36
37
  ruby-progressbar (~> 1.7)
37
38
  unicode-display_width (>= 1.4.0, < 3.0)
38
- rubocop-ast (1.4.1)
39
- parser (>= 2.7.1.5)
39
+ rubocop-ast (1.16.0)
40
+ parser (>= 3.1.1.0)
40
41
  ruby-progressbar (1.11.0)
41
- unicode-display_width (2.0.0)
42
+ unicode-display_width (2.1.0)
42
43
 
43
44
  PLATFORMS
44
45
  ruby
@@ -52,4 +53,4 @@ DEPENDENCIES
52
53
  rubocop
53
54
 
54
55
  BUNDLED WITH
55
- 2.2.3
56
+ 2.2.15
@@ -46,6 +46,10 @@ module Puma
46
46
  docstring: 'Maximum number of worker threads',
47
47
  labels: [:index],
48
48
  preset_labels: { index: 0 })
49
+ registry.gauge(:puma_requests_count,
50
+ docstring: 'Number of processed requests',
51
+ labels: [:index],
52
+ preset_labels: { index: 0 })
49
53
  registry.gauge(:puma_workers,
50
54
  docstring: 'Number of configured workers')
51
55
  .set(1)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puma
4
4
  module Metrics
5
- VERSION = '1.2.1'
5
+ VERSION = '1.2.4'
6
6
  end
7
7
  end
@@ -24,12 +24,8 @@ Puma::Plugin.create do
24
24
  launcher.events.error "Invalid control URI: #{str}"
25
25
  end
26
26
 
27
- launcher.events.register(:state) do |state|
28
- if %i[halt restart stop].include?(state)
29
- # rubocop:disable Style/SoleNestedConditional
30
- metrics.stop(true) unless metrics.shutting_down?
31
- # rubocop:enable Style/SoleNestedConditional
32
- end
27
+ launcher.events.on_stopped do
28
+ metrics.stop(true) unless metrics.shutting_down?
33
29
  end
34
30
 
35
31
  metrics.run
data/puma-metrics.gemspec CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
19
 
20
+ spec.metadata['rubygems_mfa_required'] = 'false'
21
+
20
22
  spec.required_ruby_version = '>= 2.6'
21
23
 
22
24
  spec.add_runtime_dependency 'prometheus-client', '>= 0.10'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harm-Jan Blok
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-17 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Puma plugin to export puma stats as prometheus metrics
112
- email:
112
+ email:
113
113
  executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
@@ -133,8 +133,9 @@ files:
133
133
  homepage: https://github.com/harmjanblok/puma-metrics
134
134
  licenses:
135
135
  - MIT
136
- metadata: {}
137
- post_install_message:
136
+ metadata:
137
+ rubygems_mfa_required: 'false'
138
+ post_install_message:
138
139
  rdoc_options: []
139
140
  require_paths:
140
141
  - lib
@@ -149,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
150
  - !ruby/object:Gem::Version
150
151
  version: '0'
151
152
  requirements: []
152
- rubygems_version: 3.2.3
153
- signing_key:
153
+ rubygems_version: 3.3.3
154
+ signing_key:
154
155
  specification_version: 4
155
156
  summary: Puma plugin to export puma stats as prometheus metrics
156
157
  test_files: []