promenade 0.12.6 → 0.12.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58627a85538ca904c6b25090fb615ae2585ab61c1699f25339397c25dcf1388a
4
- data.tar.gz: 91768cb3278f5519e8b6d34bd972969a12bb8880755ddef0baf88d41dcc0f91a
3
+ metadata.gz: 63e143fdb9c87d5bd17e3548528b167b10112878c9bc10161fd05ab94e23b3d2
4
+ data.tar.gz: b6951e354c8c470523d4fc35a860d97008a3189710d46406846e0dedeb18af0f
5
5
  SHA512:
6
- metadata.gz: a5dc4a8c6e32d21dbf1b661eb5884608814fc69f1fafba6fffdcd2cd566828f6c0046f88eefee49a2fdbb7ae8265c0ae4a345e7e28eaafe45517132f7bc2278f
7
- data.tar.gz: c688ecd3878042365723b3c187d5091c94b40cf594e29263b3f671d75ccef7851edac340246fcda9c115fb524b4c298da1d2dd7a94c694976ec46da6fdcd216b
6
+ metadata.gz: 1ae527b66e8973133c0478ad0e3bd0a7b256b56c3f13f68a635ceda84eba6fb1882ebda1055f84b5378f6c6fee8768c6e6faa03df47c34a5680f71843bfe60f3
7
+ data.tar.gz: a26e8e2633cd14b4ddcd29ef7cb303dd92ce15e51647033baeff98cbe37cb6386c74d9e37e359d325f4d5f991085d877b9ed8114c4521bbfb816321304b0daaa
@@ -1,41 +1,19 @@
1
- require "promenade/raindrops/stats"
2
-
3
1
  module Promenade
4
2
  module Pitchfork
5
3
  class Stats
6
- Promenade.gauge :pitchfork_workers_count do
4
+ Promenade.gauge :pitchfork_workers do
7
5
  doc "Number of workers configured"
6
+ multiprocess_mode :max
8
7
  end
9
8
 
10
- Promenade.gauge :pitchfork_live_workers_count do
9
+ Promenade.gauge :pitchfork_live_workers do
11
10
  doc "Number of live / booted workers"
12
- end
13
-
14
- Promenade.gauge :pitchfork_capacity do
15
- doc "Number of workers that are currently idle"
16
- end
17
-
18
- Promenade.gauge :pitchfork_busy_percent do
19
- doc "Percentage of workers that are currently busy"
20
- end
21
-
22
- def initialize
23
- return unless defined?(::Pitchfork::Info)
24
-
25
- @workers_count = ::Pitchfork::Info.workers_count
26
- @live_workers_count = ::Pitchfork::Info.live_workers_count
27
-
28
- raindrops_stats = Raindrops::Stats.new
29
-
30
- @active_workers = raindrops_stats.active_workers || 0
31
- @queued_requests = raindrops_stats.queued_requests || 0
11
+ multiprocess_mode :max
32
12
  end
33
13
 
34
14
  def instrument
35
- Promenade.metric(:pitchfork_workers_count).set({}, workers_count)
36
- Promenade.metric(:pitchfork_live_workers_count).set({}, live_workers_count)
37
- Promenade.metric(:pitchfork_capacity).set({}, capacity)
38
- Promenade.metric(:pitchfork_busy_percent).set({}, busy_percent)
15
+ Promenade.metric(:pitchfork_workers).set({}, workers_count)
16
+ Promenade.metric(:pitchfork_live_workers).set({}, live_workers_count)
39
17
  end
40
18
 
41
19
  def self.instrument
@@ -44,18 +22,16 @@ module Promenade
44
22
 
45
23
  private
46
24
 
47
- attr_reader :workers_count, :live_workers_count, :active_workers, :queued_requests
48
-
49
- def capacity
50
- return 0 if live_workers_count.nil? || live_workers_count == 0
25
+ def workers_count
26
+ return unless defined?(::Pitchfork::Info)
51
27
 
52
- live_workers_count - active_workers
28
+ ::Pitchfork::Info.workers_count
53
29
  end
54
30
 
55
- def busy_percent
56
- return 0 if live_workers_count == 0
31
+ def live_workers_count
32
+ return unless defined?(::Pitchfork::Info)
57
33
 
58
- (active_workers.to_f / live_workers_count) * 100
34
+ ::Pitchfork::Info.live_workers_count
59
35
  end
60
36
  end
61
37
  end
@@ -1,3 +1,3 @@
1
1
  module Promenade
2
- VERSION = "0.12.6".freeze
2
+ VERSION = "0.12.8".freeze
3
3
  end
data/promenade.gemspec CHANGED
@@ -13,13 +13,10 @@ Gem::Specification.new do |spec|
13
13
  spec.license = "MIT"
14
14
 
15
15
  # Specify which files should be added to the gem when it is released.
16
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
16
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
18
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ Dir.glob("**/*").select { |f| f.match(%r{^(lib|README|LICENSE|promenade.gemspec)}) && File.file?(f) }
19
18
  end
20
19
 
21
- spec.bindir = "exe"
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
20
  spec.require_paths = ["lib"]
24
21
 
25
22
  spec.required_ruby_version = ">= 3.2"
@@ -27,13 +24,10 @@ Gem::Specification.new do |spec|
27
24
  spec.add_dependency "actionpack"
28
25
  spec.add_dependency "activesupport", "> 6.0", "< 9.0"
29
26
  spec.add_dependency "prometheus-client-mmap", "~> 1.5"
30
- spec.add_dependency "rack"
31
- spec.add_dependency "rackup"
32
- spec.add_development_dependency "bundler", "~> 2.0"
27
+ spec.add_development_dependency "bundler", "~> 4.0"
33
28
  spec.add_development_dependency "byebug"
34
29
  spec.add_development_dependency "climate_control"
35
30
  spec.add_development_dependency "rails", "> 3.0", "< 9.0"
36
- spec.add_development_dependency "raindrops"
37
31
  spec.add_development_dependency "rake"
38
32
  spec.add_development_dependency "rspec", "~> 3.13"
39
33
  spec.add_development_dependency "rspec-rails", "~> 8.0"
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promenade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
4
+ version: 0.12.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -57,48 +57,20 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '1.5'
60
- - !ruby/object:Gem::Dependency
61
- name: rack
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: '0'
67
- type: :runtime
68
- prerelease: false
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: '0'
74
- - !ruby/object:Gem::Dependency
75
- name: rackup
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: '0'
81
- type: :runtime
82
- prerelease: false
83
- version_requirements: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
60
  - !ruby/object:Gem::Dependency
89
61
  name: bundler
90
62
  requirement: !ruby/object:Gem::Requirement
91
63
  requirements:
92
64
  - - "~>"
93
65
  - !ruby/object:Gem::Version
94
- version: '2.0'
66
+ version: '4.0'
95
67
  type: :development
96
68
  prerelease: false
97
69
  version_requirements: !ruby/object:Gem::Requirement
98
70
  requirements:
99
71
  - - "~>"
100
72
  - !ruby/object:Gem::Version
101
- version: '2.0'
73
+ version: '4.0'
102
74
  - !ruby/object:Gem::Dependency
103
75
  name: byebug
104
76
  requirement: !ruby/object:Gem::Requirement
@@ -147,20 +119,6 @@ dependencies:
147
119
  - - "<"
148
120
  - !ruby/object:Gem::Version
149
121
  version: '9.0'
150
- - !ruby/object:Gem::Dependency
151
- name: raindrops
152
- requirement: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: '0'
157
- type: :development
158
- prerelease: false
159
- version_requirements: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- version: '0'
164
122
  - !ruby/object:Gem::Dependency
165
123
  name: rake
166
124
  requirement: !ruby/object:Gem::Requirement
@@ -289,35 +247,12 @@ dependencies:
289
247
  version: '0'
290
248
  email:
291
249
  - edward-robinson@cookpad.com
292
- executables:
293
- - promenade
250
+ executables: []
294
251
  extensions: []
295
252
  extra_rdoc_files: []
296
253
  files:
297
- - ".github/workflows/ci.yaml"
298
- - ".gitignore"
299
- - ".rspec"
300
- - ".rubocop.yml"
301
- - CODE_OF_CONDUCT.md
302
- - Gemfile
303
- - Gemfile.lock
304
254
  - LICENSE
305
- - LICENSE.txt
306
255
  - README.md
307
- - Rakefile
308
- - bin/console
309
- - bin/integration_test
310
- - bin/rails
311
- - bin/setup
312
- - bin/yjit_intergration_test
313
- - codecove.yml
314
- - exe/promenade
315
- - gemfiles/7.2.3.gemfile
316
- - gemfiles/7.2.3.gemfile.lock
317
- - gemfiles/8.0.4.gemfile
318
- - gemfiles/8.0.4.gemfile.lock
319
- - gemfiles/8.1.2.gemfile
320
- - gemfiles/8.1.2.gemfile.lock
321
256
  - lib/promenade.rb
322
257
  - lib/promenade/client/rack/exception_handler.rb
323
258
  - lib/promenade/client/rack/http_request_duration_collector.rb
@@ -347,8 +282,6 @@ files:
347
282
  - lib/promenade/pitchfork/worker_pid_provider.rb
348
283
  - lib/promenade/prometheus.rb
349
284
  - lib/promenade/railtie.rb
350
- - lib/promenade/raindrops/middleware.rb
351
- - lib/promenade/raindrops/stats.rb
352
285
  - lib/promenade/setup.rb
353
286
  - lib/promenade/version.rb
354
287
  - lib/promenade/waterdrop.rb
@@ -378,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
311
  - !ruby/object:Gem::Version
379
312
  version: '0'
380
313
  requirements: []
381
- rubygems_version: 3.6.9
314
+ rubygems_version: 4.0.3
382
315
  specification_version: 4
383
316
  summary: Promenade makes it simple to instrument Ruby apps for prometheus scraping
384
317
  test_files: []
@@ -1,27 +0,0 @@
1
- name: CI
2
- on:
3
- push:
4
- branches:
5
- - master
6
- pull_request:
7
- jobs:
8
- test:
9
- strategy:
10
- fail-fast: false
11
- matrix:
12
- ruby: ["3.2", "3.3", "3.4", "4.0"]
13
- rails: ["7.2.3", "8.0.4", "8.1.2"]
14
- runs-on: ubuntu-latest
15
- env:
16
- BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails }}.gemfile
17
- steps:
18
- - uses: actions/checkout@v4
19
- - uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: ${{ matrix.ruby }}
22
- bundler-cache: true
23
- - run: bundle exec rake
24
- - name: Upload test results to Codecov
25
- uses: codecov/codecov-action@v4
26
- with:
27
- token: ${{ secrets.CODECOV_TOKEN }}
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- .rspec_status
2
- .byebug_history
3
- .rubocop-https*yml
4
- /.bundle/
5
- /coverage/
6
- /doc/
7
- /log/
8
- /pkg/
9
- /.sass-cache/
10
- /spec/reports/
11
- /spec/dummy/log
12
- /spec/dummy/tmp
13
- /tmp/
14
- /vendor/
15
- /.yardoc
16
- /_yardoc/
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,22 +0,0 @@
1
- inherit_from:
2
- - https://raw.githubusercontent.com/cookpad/guides/master/.rubocop.yml
3
-
4
- AllCops:
5
- TargetRubyVersion: 3.2
6
- NewCops: enable
7
- Exclude:
8
- - vendor/**/*
9
- - vendor/**/.*
10
-
11
- Style/TrailingCommaInHashLiteral:
12
- EnforcedStyleForMultiline: comma
13
- Style/TrailingCommaInArguments:
14
- EnforcedStyleForMultiline: comma
15
- Rails/RakeEnvironment:
16
- Enabled: false
17
- Rails/EnvironmentVariableAccess:
18
- Enabled: false
19
- RSpec/DescribedClass:
20
- Enabled: false
21
- Gemspec/DevelopmentDependencies:
22
- Enabled: false
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at edward-robinson@cookpad.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in promenade.gemspec
4
- gemspec
5
-
6
- gem "webrick"