appsignal 2.11.0.alpha.1 → 2.11.0.alpha.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: 250f9ca7d702af9daaafbbced86a9122fea07296841c65c41d64a2a9a594fded
4
- data.tar.gz: 1753bb37eaeadc98397573098a3b9cf1d718c072074ff3a2d45d3251e75db5f2
3
+ metadata.gz: 1c88daf539fd30d108a70041339bea3d9b4fbc893f091f1b7b9b6792bd7977f4
4
+ data.tar.gz: d7195e855b5a2ea44db9cfdd9c132dfb2afda1994bc4c7c8aba08181f47081d8
5
5
  SHA512:
6
- metadata.gz: 2bd72bf03e824a48fff4be825ce0ecab592f10f77a0163505a7c3f71bde0f8fbafd12642fc232f0528036416ac890ca3d29a44e84efce12a086959a6dcf1178a
7
- data.tar.gz: e82a5e2dee87442a90ab2a67b0627f4d4d787243bde54d0ee78420f8286c97f53ca97c97e0283f6991ad123180ab6303564a610159d862e2a1ffbd5921d534f8
6
+ metadata.gz: c1dda62fbb16b7cc30233a23a3d440c462bbbc1a060cfefd1207cdd7c1574d09de82e07661e9c0e3bf0dae078a8ff8c1f3990c5768dee43501b7c6fb0254a668
7
+ data.tar.gz: 9eb9618c8cb83f87db2b183573e64313a6fe01651bf2f5e93b748347de38e64716053ba7dcf42ce9a2954caa1c3e2096153acb37543a49cfe4c069afe7e8c705
@@ -33,8 +33,8 @@ global_job_config:
33
33
  - checkout
34
34
  - sem-version ruby $RUBY_VERSION
35
35
  - "./support/check_versions"
36
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE),$_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET,$_BUNDLER_CACHE-bundler-$RUBY_VERSION
37
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE),$_GEMS_CACHE-gems-$RUBY_VERSION
36
+ - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)
37
+ - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)
38
38
  - "./support/install_deps"
39
39
  - bundle config set clean 'true'
40
40
  - "./support/bundler_wrapper install --jobs=3 --retry=3"
@@ -172,20 +172,6 @@ blocks:
172
172
  value: 1.17.3
173
173
  commands:
174
174
  - "./support/bundler_wrapper exec rake test"
175
- - name: Ruby 2.0.0-p648 for padrino
176
- env_vars:
177
- - name: RUBY_VERSION
178
- value: 2.0.0-p648
179
- - name: GEMSET
180
- value: padrino
181
- - name: BUNDLE_GEMFILE
182
- value: gemfiles/padrino.gemfile
183
- - name: _RUBYGEMS_VERSION
184
- value: 2.7.8
185
- - name: _BUNDLER_VERSION
186
- value: 1.17.3
187
- commands:
188
- - "./support/bundler_wrapper exec rake test"
189
175
  - name: Ruby 2.0.0-p648 for que
190
176
  env_vars:
191
177
  - name: RUBY_VERSION
@@ -527,7 +513,7 @@ blocks:
527
513
  - name: _RUBYGEMS_VERSION
528
514
  value: latest
529
515
  - name: _BUNDLER_VERSION
530
- value: 1.17.3
516
+ value: latest
531
517
  commands:
532
518
  - "./support/bundler_wrapper exec rake test"
533
519
  - name: Ruby 2.6.5 for que
@@ -684,7 +670,7 @@ blocks:
684
670
  value: latest
685
671
  commands:
686
672
  - "./support/bundler_wrapper exec rake test"
687
- - name: Ruby 2.7.0
673
+ - name: Ruby 2.7.1
688
674
  dependencies:
689
675
  - Validation
690
676
  task:
@@ -692,10 +678,10 @@ blocks:
692
678
  commands:
693
679
  - "./support/bundler_wrapper exec rake extension:install"
694
680
  jobs:
695
- - name: Ruby 2.7.0 for no_dependencies
681
+ - name: Ruby 2.7.1 for no_dependencies
696
682
  env_vars:
697
683
  - name: RUBY_VERSION
698
- value: 2.7.0
684
+ value: 2.7.1
699
685
  - name: GEMSET
700
686
  value: no_dependencies
701
687
  - name: BUNDLE_GEMFILE
@@ -706,18 +692,18 @@ blocks:
706
692
  value: latest
707
693
  commands:
708
694
  - "./support/bundler_wrapper exec rake test"
709
- - name: Ruby 2.7.0 - Gems
695
+ - name: Ruby 2.7.1 - Gems
710
696
  dependencies:
711
- - Ruby 2.7.0
697
+ - Ruby 2.7.1
712
698
  task:
713
699
  prologue:
714
700
  commands:
715
701
  - "./support/bundler_wrapper exec rake extension:install"
716
702
  jobs:
717
- - name: Ruby 2.7.0 for capistrano2
703
+ - name: Ruby 2.7.1 for capistrano2
718
704
  env_vars:
719
705
  - name: RUBY_VERSION
720
- value: 2.7.0
706
+ value: 2.7.1
721
707
  - name: GEMSET
722
708
  value: capistrano2
723
709
  - name: BUNDLE_GEMFILE
@@ -728,10 +714,10 @@ blocks:
728
714
  value: latest
729
715
  commands:
730
716
  - "./support/bundler_wrapper exec rake test"
731
- - name: Ruby 2.7.0 for capistrano3
717
+ - name: Ruby 2.7.1 for capistrano3
732
718
  env_vars:
733
719
  - name: RUBY_VERSION
734
- value: 2.7.0
720
+ value: 2.7.1
735
721
  - name: GEMSET
736
722
  value: capistrano3
737
723
  - name: BUNDLE_GEMFILE
@@ -742,10 +728,10 @@ blocks:
742
728
  value: latest
743
729
  commands:
744
730
  - "./support/bundler_wrapper exec rake test"
745
- - name: Ruby 2.7.0 for grape
731
+ - name: Ruby 2.7.1 for grape
746
732
  env_vars:
747
733
  - name: RUBY_VERSION
748
- value: 2.7.0
734
+ value: 2.7.1
749
735
  - name: GEMSET
750
736
  value: grape
751
737
  - name: BUNDLE_GEMFILE
@@ -756,10 +742,10 @@ blocks:
756
742
  value: latest
757
743
  commands:
758
744
  - "./support/bundler_wrapper exec rake test"
759
- - name: Ruby 2.7.0 for padrino
745
+ - name: Ruby 2.7.1 for padrino
760
746
  env_vars:
761
747
  - name: RUBY_VERSION
762
- value: 2.7.0
748
+ value: 2.7.1
763
749
  - name: GEMSET
764
750
  value: padrino
765
751
  - name: BUNDLE_GEMFILE
@@ -767,13 +753,13 @@ blocks:
767
753
  - name: _RUBYGEMS_VERSION
768
754
  value: latest
769
755
  - name: _BUNDLER_VERSION
770
- value: 1.17.3
756
+ value: latest
771
757
  commands:
772
758
  - "./support/bundler_wrapper exec rake test"
773
- - name: Ruby 2.7.0 for que
759
+ - name: Ruby 2.7.1 for que
774
760
  env_vars:
775
761
  - name: RUBY_VERSION
776
- value: 2.7.0
762
+ value: 2.7.1
777
763
  - name: GEMSET
778
764
  value: que
779
765
  - name: BUNDLE_GEMFILE
@@ -784,10 +770,10 @@ blocks:
784
770
  value: latest
785
771
  commands:
786
772
  - "./support/bundler_wrapper exec rake test"
787
- - name: Ruby 2.7.0 for que_beta
773
+ - name: Ruby 2.7.1 for que_beta
788
774
  env_vars:
789
775
  - name: RUBY_VERSION
790
- value: 2.7.0
776
+ value: 2.7.1
791
777
  - name: GEMSET
792
778
  value: que_beta
793
779
  - name: BUNDLE_GEMFILE
@@ -798,10 +784,10 @@ blocks:
798
784
  value: latest
799
785
  commands:
800
786
  - "./support/bundler_wrapper exec rake test"
801
- - name: Ruby 2.7.0 for rails-5.0
787
+ - name: Ruby 2.7.1 for rails-5.0
802
788
  env_vars:
803
789
  - name: RUBY_VERSION
804
- value: 2.7.0
790
+ value: 2.7.1
805
791
  - name: GEMSET
806
792
  value: rails-5.0
807
793
  - name: BUNDLE_GEMFILE
@@ -812,10 +798,10 @@ blocks:
812
798
  value: latest
813
799
  commands:
814
800
  - "./support/bundler_wrapper exec rake test"
815
- - name: Ruby 2.7.0 for rails-5.1
801
+ - name: Ruby 2.7.1 for rails-5.1
816
802
  env_vars:
817
803
  - name: RUBY_VERSION
818
- value: 2.7.0
804
+ value: 2.7.1
819
805
  - name: GEMSET
820
806
  value: rails-5.1
821
807
  - name: BUNDLE_GEMFILE
@@ -826,10 +812,10 @@ blocks:
826
812
  value: latest
827
813
  commands:
828
814
  - "./support/bundler_wrapper exec rake test"
829
- - name: Ruby 2.7.0 for rails-5.2
815
+ - name: Ruby 2.7.1 for rails-5.2
830
816
  env_vars:
831
817
  - name: RUBY_VERSION
832
- value: 2.7.0
818
+ value: 2.7.1
833
819
  - name: GEMSET
834
820
  value: rails-5.2
835
821
  - name: BUNDLE_GEMFILE
@@ -840,10 +826,10 @@ blocks:
840
826
  value: latest
841
827
  commands:
842
828
  - "./support/bundler_wrapper exec rake test"
843
- - name: Ruby 2.7.0 for rails-6.0
829
+ - name: Ruby 2.7.1 for rails-6.0
844
830
  env_vars:
845
831
  - name: RUBY_VERSION
846
- value: 2.7.0
832
+ value: 2.7.1
847
833
  - name: GEMSET
848
834
  value: rails-6.0
849
835
  - name: BUNDLE_GEMFILE
@@ -854,10 +840,10 @@ blocks:
854
840
  value: latest
855
841
  commands:
856
842
  - "./support/bundler_wrapper exec rake test"
857
- - name: Ruby 2.7.0 for resque
843
+ - name: Ruby 2.7.1 for resque
858
844
  env_vars:
859
845
  - name: RUBY_VERSION
860
- value: 2.7.0
846
+ value: 2.7.1
861
847
  - name: GEMSET
862
848
  value: resque
863
849
  - name: BUNDLE_GEMFILE
@@ -868,10 +854,10 @@ blocks:
868
854
  value: 1.17.3
869
855
  commands:
870
856
  - "./support/bundler_wrapper exec rake test"
871
- - name: Ruby 2.7.0 for sequel
857
+ - name: Ruby 2.7.1 for sequel
872
858
  env_vars:
873
859
  - name: RUBY_VERSION
874
- value: 2.7.0
860
+ value: 2.7.1
875
861
  - name: GEMSET
876
862
  value: sequel
877
863
  - name: BUNDLE_GEMFILE
@@ -882,10 +868,10 @@ blocks:
882
868
  value: latest
883
869
  commands:
884
870
  - "./support/bundler_wrapper exec rake test"
885
- - name: Ruby 2.7.0 for sequel-435
871
+ - name: Ruby 2.7.1 for sequel-435
886
872
  env_vars:
887
873
  - name: RUBY_VERSION
888
- value: 2.7.0
874
+ value: 2.7.1
889
875
  - name: GEMSET
890
876
  value: sequel-435
891
877
  - name: BUNDLE_GEMFILE
@@ -896,10 +882,10 @@ blocks:
896
882
  value: latest
897
883
  commands:
898
884
  - "./support/bundler_wrapper exec rake test"
899
- - name: Ruby 2.7.0 for sinatra
885
+ - name: Ruby 2.7.1 for sinatra
900
886
  env_vars:
901
887
  - name: RUBY_VERSION
902
- value: 2.7.0
888
+ value: 2.7.1
903
889
  - name: GEMSET
904
890
  value: sinatra
905
891
  - name: BUNDLE_GEMFILE
@@ -910,10 +896,10 @@ blocks:
910
896
  value: latest
911
897
  commands:
912
898
  - "./support/bundler_wrapper exec rake test"
913
- - name: Ruby 2.7.0 for webmachine
899
+ - name: Ruby 2.7.1 for webmachine
914
900
  env_vars:
915
901
  - name: RUBY_VERSION
916
- value: 2.7.0
902
+ value: 2.7.1
917
903
  - name: GEMSET
918
904
  value: webmachine
919
905
  - name: BUNDLE_GEMFILE
@@ -2,7 +2,9 @@
2
2
 
3
3
  # 2.11.0
4
4
  - Track queue time regardless of namespace. Support custom namespaces. PR #602
5
- - Report Ruby environment metadata. PR #621
5
+ - Improve deprecation message from frontend error middleware. PR #620
6
+ - Report Ruby environment metadata. PR #621, #627
7
+ - Refactor: Move minutely probes to their own files and modules. PR #623
6
8
 
7
9
  # 2.10.9
8
10
  - Use http proxy if configured when downloading agent. PR #606
@@ -34,8 +34,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
34
34
  - checkout
35
35
  - sem-version ruby $RUBY_VERSION
36
36
  - ./support/check_versions
37
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE),$_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET,$_BUNDLER_CACHE-bundler-$RUBY_VERSION
38
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE),$_GEMS_CACHE-gems-$RUBY_VERSION
37
+ - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)
38
+ - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)
39
39
  - ./support/install_deps
40
40
  - bundle config set clean 'true'
41
41
  - ./support/bundler_wrapper install --jobs=3 --retry=3
@@ -115,7 +115,7 @@ matrix:
115
115
  - ruby: "2.5.7"
116
116
  gems: "minimal"
117
117
  - ruby: "2.6.5"
118
- - ruby: "2.7.0"
118
+ - ruby: "2.7.1"
119
119
  - ruby: "jruby-9.1.17.0"
120
120
  gems: "minimal"
121
121
  gems:
@@ -124,7 +124,9 @@ matrix:
124
124
  - gem: "capistrano3"
125
125
  - gem: "grape"
126
126
  - gem: "padrino"
127
- bundler: "1.17.3"
127
+ exclude:
128
+ ruby:
129
+ - "2.0.0-p648"
128
130
  - gem: "que"
129
131
  - gem: "que_beta"
130
132
  exclude:
@@ -135,13 +137,13 @@ matrix:
135
137
  exclude:
136
138
  ruby:
137
139
  - "2.6.5"
138
- - "2.7.0"
140
+ - "2.7.1"
139
141
  - gem: "rails-4.2"
140
142
  bundler: "1.17.3"
141
143
  exclude:
142
144
  ruby:
143
145
  - "2.6.5"
144
- - "2.7.0"
146
+ - "2.7.1"
145
147
  - gem: "rails-5.0"
146
148
  exclude:
147
149
  ruby:
@@ -1,70 +1,70 @@
1
1
  ---
2
- version: 38a8a6f
2
+ version: 710d341
3
3
  mirrors:
4
4
  - https://appsignal-agent-releases.global.ssl.fastly.net
5
5
  - https://d135dj0rjqvssy.cloudfront.net
6
6
  triples:
7
7
  x86_64-darwin:
8
8
  static:
9
- checksum: 47f24cd09ab00fe3419a313c52d97170c9555d3ea85c8bd98cbb295df29456dd
9
+ checksum: 47f53b67d5e28e23859ed7bbcc6cde7ba3c142bf0f7c32ffa0d89c628178d4cc
10
10
  filename: appsignal-x86_64-darwin-all-static.tar.gz
11
11
  dynamic:
12
- checksum: a26437fbd4c97ff0b69bf42e83d968647532648313227224df1bbbd0ed105104
12
+ checksum: 0b2b1533cf5c6f400fbe367fd6a3200c60ecfe6cd8b44a6707bc2a57ef78fe4d
13
13
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
14
14
  universal-darwin:
15
15
  static:
16
- checksum: 47f24cd09ab00fe3419a313c52d97170c9555d3ea85c8bd98cbb295df29456dd
16
+ checksum: 47f53b67d5e28e23859ed7bbcc6cde7ba3c142bf0f7c32ffa0d89c628178d4cc
17
17
  filename: appsignal-x86_64-darwin-all-static.tar.gz
18
18
  dynamic:
19
- checksum: a26437fbd4c97ff0b69bf42e83d968647532648313227224df1bbbd0ed105104
19
+ checksum: 0b2b1533cf5c6f400fbe367fd6a3200c60ecfe6cd8b44a6707bc2a57ef78fe4d
20
20
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
21
21
  i686-linux:
22
22
  static:
23
- checksum: ae37b329907cead537cf2a87a562ee92120add6c8874bc2e9235e5c537bca692
23
+ checksum: d815dd40495175a83d1bed0facfb97a472a74bdfe7aafbe6f72192e66b45a559
24
24
  filename: appsignal-i686-linux-all-static.tar.gz
25
25
  dynamic:
26
- checksum: ee5da14c7b5d2cc2dc2ae345d19c33a08c7e4861975e34878c1c295e57b2d8bc
26
+ checksum: 2e785cf04d500eaad577c3391d236c38d850fed9b541a0e79803ee9bf66852aa
27
27
  filename: appsignal-i686-linux-all-dynamic.tar.gz
28
28
  x86-linux:
29
29
  static:
30
- checksum: ae37b329907cead537cf2a87a562ee92120add6c8874bc2e9235e5c537bca692
30
+ checksum: d815dd40495175a83d1bed0facfb97a472a74bdfe7aafbe6f72192e66b45a559
31
31
  filename: appsignal-i686-linux-all-static.tar.gz
32
32
  dynamic:
33
- checksum: ee5da14c7b5d2cc2dc2ae345d19c33a08c7e4861975e34878c1c295e57b2d8bc
33
+ checksum: 2e785cf04d500eaad577c3391d236c38d850fed9b541a0e79803ee9bf66852aa
34
34
  filename: appsignal-i686-linux-all-dynamic.tar.gz
35
35
  i686-linux-musl:
36
36
  static:
37
- checksum: d2d6dfd5d86b229449c73c74ac6b922eeff981f451dd599cbc8b9f2b7a715931
37
+ checksum: 4c66f26fb7925445ba0bb353cbf753f00572ffdae16a28220f6306bcb34a686b
38
38
  filename: appsignal-i686-linux-musl-all-static.tar.gz
39
39
  x86-linux-musl:
40
40
  static:
41
- checksum: d2d6dfd5d86b229449c73c74ac6b922eeff981f451dd599cbc8b9f2b7a715931
41
+ checksum: 4c66f26fb7925445ba0bb353cbf753f00572ffdae16a28220f6306bcb34a686b
42
42
  filename: appsignal-i686-linux-musl-all-static.tar.gz
43
43
  x86_64-linux:
44
44
  static:
45
- checksum: 6b05c04df7de65be742942926c79e4d322a02dd3b18552b4eb42b420b67df214
45
+ checksum: d59929c9b2075eb93f0b66a8f9ea4d7d90a897b996a4ff054fd68610282ed616
46
46
  filename: appsignal-x86_64-linux-all-static.tar.gz
47
47
  dynamic:
48
- checksum: de2f7325d2d7d01632abe9eb135f51376ed3769167e0675b7e7c6de9702c057c
48
+ checksum: b1d22b323fdf9d8dbce17194ae42d3f7ddb252342db70428aea1c6baab5e6959
49
49
  filename: appsignal-x86_64-linux-all-dynamic.tar.gz
50
50
  x86_64-linux-musl:
51
51
  static:
52
- checksum: 2a852991c740f93d83dbd3b34daaef45f2ebb02a921200734a6f715790d44968
52
+ checksum: 7b8cd90260f6bc31ed2aa61dac8889a79a8c5b35f453b2f9d47d1e74133d2c2f
53
53
  filename: appsignal-x86_64-linux-musl-all-static.tar.gz
54
54
  dynamic:
55
- checksum: 03fc01d09698b95a5686fc08e4cd1f35913a53413e0ae8ced877c0e7f8ca260e
55
+ checksum: 8922f1e3a845ea869a1553aeb87681346c709dbab96636f703dfc3bc855621d8
56
56
  filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
57
57
  x86_64-freebsd:
58
58
  static:
59
- checksum: 3a26b9a4a1c7e412f6602f4bbae8dd95ad248b41e033b967163bae2f6fac0e96
59
+ checksum: bb15ae46b7df4f2851982bcd8b079cd6b5ea384c19eaed9f20cdf152e435c4ea
60
60
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
61
61
  dynamic:
62
- checksum: 4eda2bdb88670854abb07ad716e2d46de298dd8549835468c4a778f74c6a7b0e
62
+ checksum: 0be60faf18df3eddedd5d85e34fdbcccb3ce6aae52ef6faeebe881c3e0fe2022
63
63
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
64
64
  amd64-freebsd:
65
65
  static:
66
- checksum: 3a26b9a4a1c7e412f6602f4bbae8dd95ad248b41e033b967163bae2f6fac0e96
66
+ checksum: bb15ae46b7df4f2851982bcd8b079cd6b5ea384c19eaed9f20cdf152e435c4ea
67
67
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
68
68
  dynamic:
69
- checksum: 4eda2bdb88670854abb07ad716e2d46de298dd8549835468c4a778f74c6a7b0e
69
+ checksum: 0be60faf18df3eddedd5d85e34fdbcccb3ce6aae52ef6faeebe881c3e0fe2022
70
70
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'padrino', '~> 0.13.0'
4
- gem 'rack', '~> 1.6'
3
+ gem 'padrino', "~> 0.15"
4
+ gem 'rack'
5
5
 
6
6
  gemspec :path => '../'
@@ -24,7 +24,8 @@ module Appsignal
24
24
  # runs in the Puma main process.
25
25
  # For more information:
26
26
  # https://docs.appsignal.com/ruby/integrations/puma.html
27
- Appsignal::Minutely.probes.register :puma, PumaProbe
27
+ require "appsignal/probes/puma"
28
+ Appsignal::Minutely.probes.register :puma, ::Appsignal::Probes::PumaProbe
28
29
  end
29
30
 
30
31
  return unless defined?(::Puma::Cluster)
@@ -39,62 +40,5 @@ module Appsignal
39
40
  end
40
41
  end
41
42
  end
42
-
43
- class PumaProbe
44
- def initialize
45
- @hostname = Appsignal.config[:hostname] || Socket.gethostname
46
- end
47
-
48
- def call
49
- puma_stats = fetch_puma_stats
50
- return unless puma_stats
51
-
52
- stats = JSON.parse puma_stats, :symbolize_names => true
53
- counts = {}
54
- count_keys = [:backlog, :running, :pool_capacity, :max_threads]
55
-
56
- if stats[:worker_status] # Multiple workers
57
- stats[:worker_status].each do |worker|
58
- stat = worker[:last_status]
59
- count_keys.each do |key|
60
- count_if_present counts, key, stat
61
- end
62
- end
63
-
64
- gauge(:workers, stats[:workers], :type => :count)
65
- gauge(:workers, stats[:booted_workers], :type => :booted)
66
- gauge(:workers, stats[:old_workers], :type => :old)
67
- else # Single worker
68
- count_keys.each do |key|
69
- count_if_present counts, key, stats
70
- end
71
- end
72
-
73
- gauge(:connection_backlog, counts[:backlog]) if counts[:backlog]
74
- gauge(:pool_capacity, counts[:pool_capacity]) if counts[:pool_capacity]
75
- gauge(:threads, counts[:running], :type => :running) if counts[:running]
76
- gauge(:threads, counts[:max_threads], :type => :max) if counts[:max_threads]
77
- end
78
-
79
- private
80
-
81
- attr_reader :hostname
82
-
83
- def gauge(field, count, tags = {})
84
- Appsignal.set_gauge("puma_#{field}", count, tags.merge(:hostname => hostname))
85
- end
86
-
87
- def count_if_present(counts, key, stats)
88
- stat_value = stats[key]
89
- return unless stat_value
90
- counts[key] ||= 0
91
- counts[key] += stat_value
92
- end
93
-
94
- def fetch_puma_stats
95
- ::Puma.stats
96
- rescue NoMethodError # rubocop:disable Lint/HandleExceptions
97
- end
98
- end
99
43
  end
100
44
  end