promenade 0.12.1 → 0.12.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: bb2dbe0d103ff6ea073b522ad86a19e45157b39cb543bcd28b19bea3e67e61db
4
- data.tar.gz: 996c08318d59dd7566a0672270ee7309f23582b972e6956b878b6bb09f871d1f
3
+ metadata.gz: 9be9950116dea78f1a07e2b4ec1cd0d8a290c48f390e75f95b88cb9687b5db48
4
+ data.tar.gz: 24b9e9275600f6cfe014505b0752efad476bcb9498c6d1653db6c75b512db4c4
5
5
  SHA512:
6
- metadata.gz: d2229ff8f71723344362f38ad8c2828cfb36d1d23b1b0b78a6feb29133e9d6a31a6baa5acbb62a7412f01f1825e81165079163e7bbc3ce72117f54286bf0d188
7
- data.tar.gz: 7aef5ad799f1be6d8bc7465bb30b91fc5a506e3c088f7d24b15c01bfb21abb1b7d187c115ff6a34865a2840e98c6446f20adf2a14571988a558347574253c355
6
+ metadata.gz: 4a91f14302d8dc02706233f5d7c92819f7dd2878d07affdd9610018f3993b20ca737514e0ed88d6a1fd4cc9a82182f03dd00181d88242c25e9a2424347f39584
7
+ data.tar.gz: 9c8399ffab1eb5b6d4166063e763b7d06f9e80440bdc42769f3dd149ba0399676212f3169480e4fb3599da5f51c2efae6b60a90e65862f9abea4d9e95c6d7ca6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- promenade (0.12.1)
4
+ promenade (0.12.2)
5
5
  actionpack
6
6
  activesupport (> 6.0, < 8.0)
7
7
  prometheus-client-mmap (~> 1.1)
@@ -2,11 +2,13 @@ require "promenade/setup"
2
2
  require "promenade/engine"
3
3
  require "promenade/client/rack/http_request_duration_collector"
4
4
  require "promenade/client/rack/http_request_queue_time_collector"
5
+ require "promenade/yjit/middleware"
5
6
 
6
7
  module Promenade
7
8
  class Railtie < ::Rails::Railtie
8
9
  initializer "promenade.configure_rails_initialization" do
9
10
  Promenade.setup
11
+ Rails.application.config.middleware.use Promenade::YJIT::Middlware if defined? ::RubyVM::YJIT
10
12
  Rails.application.config.middleware.insert_after ActionDispatch::ShowExceptions,
11
13
  Promenade::Client::Rack::HTTPRequestDurationCollector
12
14
  Rails.application.config.middleware.insert 0,
@@ -1,3 +1,3 @@
1
1
  module Promenade
2
- VERSION = "0.12.1".freeze
2
+ VERSION = "0.12.2".freeze
3
3
  end
@@ -0,0 +1,22 @@
1
+ require "promenade/yjit/stats"
2
+
3
+ module Promenade
4
+ module YJIT
5
+ class Middlware
6
+ RACK_AFTER_REPLY = "rack.after_reply".freeze
7
+
8
+ def initialize(app)
9
+ @app = app
10
+ end
11
+
12
+ def call(env)
13
+ if env.key?(RACK_AFTER_REPLY)
14
+ env[RACK_AFTER_REPLY] << -> {
15
+ ::Promenade::YJIT::Stats.instrument
16
+ }
17
+ end
18
+ @app.call(env)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ module Promenade
2
+ module YJIT
3
+ class Stats
4
+ Promenade.gauge :ruby_yjit_code_region_size do
5
+ doc "Ruby YJIT code size"
6
+ end
7
+
8
+ def self.instrument
9
+ return unless defined?(::RubyVM::YJIT) && ::RubyVM::YJIT.enabled?
10
+
11
+ Promenade.metric(:ruby_yjit_code_region_size).set({}, ::RubyVM::YJIT.runtime_stats[:code_region_size])
12
+ end
13
+ end
14
+ end
15
+ end
data/lib/promenade.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "promenade/version"
2
2
  require "promenade/setup"
3
3
  require "promenade/configuration"
4
- require "promenade/railtie" if defined? Rails::Railtie
5
4
  require "promenade/prometheus"
6
5
 
7
6
  module Promenade
@@ -25,3 +24,5 @@ module Promenade
25
24
  end
26
25
  end
27
26
  end
27
+
28
+ require "promenade/railtie" if defined? Rails::Railtie
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promenade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-09 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -316,6 +316,8 @@ files:
316
316
  - lib/promenade/waterdrop/message_subscriber.rb
317
317
  - lib/promenade/waterdrop/statistics_subscriber.rb
318
318
  - lib/promenade/waterdrop/subscriber.rb
319
+ - lib/promenade/yjit/middleware.rb
320
+ - lib/promenade/yjit/stats.rb
319
321
  - promenade.gemspec
320
322
  homepage: https://github.com/errm/promenade
321
323
  licenses:
@@ -337,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
339
  - !ruby/object:Gem::Version
338
340
  version: '0'
339
341
  requirements: []
340
- rubygems_version: 3.4.10
342
+ rubygems_version: 3.5.3
341
343
  signing_key:
342
344
  specification_version: 4
343
345
  summary: Promenade makes it simple to instrument Ruby apps for prometheus scraping