puma-newrelic 0.1.2 → 0.1.5

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: d71604cc58d401a09f4f6127cebce98b64b2c3a0192a5fb0aacf66b443943dc4
4
- data.tar.gz: a39dd62912deca30c2fb9435a126f709cade9040023252ed22221237fdcb9167
3
+ metadata.gz: 912025b2b896f3f114ce304d95c3489a8bcd7dc00f22d92144e91fdf579f571f
4
+ data.tar.gz: d5140ffef3a7b698bc8f7002e983c832547b8453f4ecfd06e6846d56b82e3224
5
5
  SHA512:
6
- metadata.gz: 5e394f02f72225ddc67f7141cbc1c8f240a7e4cd5473dd0156ef1537203e7e21d8a1e0db34a65da2ca51cd4e9ce553e890c23fabcb96f07f9b98eddfdb81d93a
7
- data.tar.gz: 796b96233b9b5333cb86ef7f69f1a5b1beedcd790ca8b54d4d2fe03b38376f0950dbba57acfd5b80f72af852d5befbe5bb24c5269ca9e9d41e5b297421e50ff0
6
+ metadata.gz: 4be95be7f92d9f14859c231b0e4aa4613dd29f1377bafbaa04bc885037c71559fadb56459d546402488d84586854f7e9e52ed0a7fce32552330e7954f2314552
7
+ data.tar.gz: 56cb5e2ec93f7a448ea43a9a57499b3c1d20baa431a6913a62f82174a7f738d264805dd867ed4f6d92e5860b48911155c331c88aab91acac8c36a21cd6a807d2
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /.bundle/
2
+ /.idea/
2
3
  /.yardoc
3
4
  /_yardoc/
4
5
  /coverage/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puma-newrelic (0.1.2)
4
+ puma-newrelic (0.1.3)
5
5
  puma (>= 3.0)
6
6
 
7
7
  GEM
@@ -2,10 +2,10 @@ module Puma
2
2
  module NewRelic
3
3
  class Sampler
4
4
  def initialize(launcher)
5
- config = ::NewRelic::Agent.config[:puma]
5
+ config = ::NewRelic::Agent.config[:puma] || {}
6
6
  @launcher = launcher
7
7
  @sample_rate = config.fetch("sample_rate", 15)
8
- @keys = config.fetch("keys", %i(backlog running pool_capacity max_threads))
8
+ @keys = config.fetch("keys", %w(backlog running pool_capacity max_threads)).map(&:to_s)
9
9
  @last_sample_at = Time.now
10
10
  end
11
11
 
@@ -39,7 +39,7 @@ module Puma
39
39
 
40
40
  def parse(stats)
41
41
  metrics = Hash.new { |h, k| h[k] = 0 }
42
- sum = ->(key, value) { metrics[key] += value if @keys.include?(key) }
42
+ sum = ->(key, value) { metrics[key.to_s.gsub("puma_", "")] += value if @keys.include?(key.to_s.gsub("puma_", "")) }
43
43
 
44
44
  if stats[:workers]
45
45
  metrics[:workers] = stats[:workers]
@@ -1,5 +1,5 @@
1
1
  module Puma
2
2
  module NewRelic
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-newrelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2022-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
@@ -49,7 +49,7 @@ files:
49
49
  homepage: https://github.com/benoist/puma-newrelic
50
50
  licenses: []
51
51
  metadata: {}
52
- post_install_message:
52
+ post_install_message:
53
53
  rdoc_options: []
54
54
  require_paths:
55
55
  - lib
@@ -64,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.0.3
68
- signing_key:
67
+ rubygems_version: 3.1.6
68
+ signing_key:
69
69
  specification_version: 4
70
70
  summary: New Relic Puma Stats sampler
71
71
  test_files: []