puma-plugin-telemetry 1.1.1 → 1.1.2

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: 1b31aee911567917f13e7f977ddeef8151bf77e0ce4c42c3d55cacb72e484282
4
- data.tar.gz: 7d77fce9892123332269b790e99f3304b3ed6f964a2c6693e8490e32b1e90aa7
3
+ metadata.gz: b3992737163fb68bb64e961ac4012e8d00b43e4464cd37b945a62495d8acdef8
4
+ data.tar.gz: bc723cd155b0104b563c9795e3598a14ba4c24c53990b87050ba5aacce7fb831
5
5
  SHA512:
6
- metadata.gz: ab0213de9d5ab7501e073fe4741ab6c2d5d42789ca9373e33833e86312c3414ee22376192d97a7c45d0c84df429202d2ba0feb7f410daf947fdb660e0e5d2322
7
- data.tar.gz: 63cb99867fef6f6f5f491bf37634b1dcdf17e5c5f279c9f032c164bb24887f85a193258e88511b7112be9a4539db4460a8910f3f9332d783fb168cf92eab7406
6
+ metadata.gz: 111bbc32976f4fbb619b2240a1229ae376e56a5c9269f138507528b851e2824048730660719da512b85069a93c05fe24d9419a4a70ac0c3c95ba64752f69725a
7
+ data.tar.gz: 7c57a55fd2701507f9eeb23d4231041ab41321b3a365f11af42ca70cdb768abc6c5421ace812c868277fdd3234c1997b453b3aca62f6bd82380b03679a82100f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.1.2]
11
+
12
+ - Add Puma 6 compatibility
10
13
  ## [1.1.1]
11
14
 
12
15
  Public release.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puma-plugin-telemetry (1.1.1)
5
- puma (>= 5.0)
4
+ puma-plugin-telemetry (1.1.2)
5
+ puma (< 7)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -14,7 +14,7 @@ GEM
14
14
  parallel (1.22.1)
15
15
  parser (3.1.2.0)
16
16
  ast (~> 2.4.1)
17
- puma (5.6.4)
17
+ puma (6.0.1)
18
18
  nio4r (~> 2.0)
19
19
  rack (2.2.3.1)
20
20
  rainbow (3.1.1)
@@ -64,4 +64,4 @@ DEPENDENCIES
64
64
  rubocop-performance (~> 1.9)
65
65
 
66
66
  BUNDLED WITH
67
- 2.1.4
67
+ 2.3.12
@@ -3,7 +3,7 @@
3
3
  module Puma
4
4
  class Plugin
5
5
  module Telemetry
6
- VERSION = '1.1.1'
6
+ VERSION = '1.1.2'
7
7
  end
8
8
  end
9
9
  end
@@ -63,13 +63,14 @@ module Puma
63
63
  #
64
64
  module PluginInstanceMethods
65
65
  def start(launcher)
66
+ @launcher = launcher
67
+
66
68
  unless Puma::Plugin::Telemetry.config.enabled?
67
- launcher.events.log 'plugin=telemetry msg="disabled, exiting..."'
69
+ log_writer.log 'plugin=telemetry msg="disabled, exiting..."'
68
70
  return
69
71
  end
70
72
 
71
- @launcher = launcher
72
- @launcher.events.log 'plugin=telemetry msg="enabled, setting up runner..."'
73
+ log_writer.log 'plugin=telemetry msg="enabled, setting up runner..."'
73
74
 
74
75
  in_background do
75
76
  sleep Puma::Plugin::Telemetry.config.initial_delay
@@ -79,13 +80,13 @@ module Puma
79
80
 
80
81
  def run!
81
82
  loop do
82
- @launcher.events.debug 'plugin=telemetry msg="publish"'
83
+ log_writer.debug 'plugin=telemetry msg="publish"'
83
84
 
84
85
  call(Puma::Plugin::Telemetry.build(@launcher))
85
86
  rescue Errno::EPIPE
86
87
  # Occurs when trying to output to STDOUT while puma is shutting down
87
88
  rescue StandardError => e
88
- @launcher.events.error "plugin=telemetry err=#{e.class} msg=#{e.message.inspect}"
89
+ log_writer.error "plugin=telemetry err=#{e.class} msg=#{e.message.inspect}"
89
90
  ensure
90
91
  sleep Puma::Plugin::Telemetry.config.frequency
91
92
  end
@@ -96,6 +97,16 @@ module Puma
96
97
  target.call(telemetry)
97
98
  end
98
99
  end
100
+
101
+ private
102
+
103
+ def log_writer
104
+ if Puma::Const::PUMA_VERSION.to_i < 6
105
+ @launcher.events
106
+ else
107
+ @launcher.log_writer
108
+ end
109
+ end
99
110
  end
100
111
  end
101
112
  end
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
39
39
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
40
40
  spec.require_paths = ['lib']
41
41
 
42
- spec.add_dependency 'puma', '>= 5.0'
42
+ spec.add_dependency 'puma', '< 7'
43
43
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-plugin-telemetry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leszek Zalewski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2022-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '7'
27
27
  description: |
28
28
  Puma plugin which should be able to handle all your metric needs regarding your webserver:
29
29