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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/promenade/railtie.rb +2 -0
- data/lib/promenade/version.rb +1 -1
- data/lib/promenade/yjit/middleware.rb +22 -0
- data/lib/promenade/yjit/stats.rb +15 -0
- data/lib/promenade.rb +2 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be9950116dea78f1a07e2b4ec1cd0d8a290c48f390e75f95b88cb9687b5db48
|
4
|
+
data.tar.gz: 24b9e9275600f6cfe014505b0752efad476bcb9498c6d1653db6c75b512db4c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a91f14302d8dc02706233f5d7c92819f7dd2878d07affdd9610018f3993b20ca737514e0ed88d6a1fd4cc9a82182f03dd00181d88242c25e9a2424347f39584
|
7
|
+
data.tar.gz: 9c8399ffab1eb5b6d4166063e763b7d06f9e80440bdc42769f3dd149ba0399676212f3169480e4fb3599da5f51c2efae6b60a90e65862f9abea4d9e95c6d7ca6
|
data/Gemfile.lock
CHANGED
data/lib/promenade/railtie.rb
CHANGED
@@ -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,
|
data/lib/promenade/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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
|