rorvswild 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rorvswild/plugin/middleware.rb +31 -0
- data/lib/rorvswild/version.rb +1 -1
- metadata +3 -3
- data/lib/rorvswild/plugin/action_dispatch.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f458deb05f3508f795dc06993742ee466d8615e86886f5997bf0d1743d3adb0
|
4
|
+
data.tar.gz: ea17ef8609b1587c259a074a08f3b3657960b2fe8e76ac533ed3778464f820f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7402dd0a270265faf614b4ea6919b1b9469b164a8b844b2814a73426a663ce83b144fc3208b2eae2dee3377a1d0f88ffe1e716e60fc3876e7a07ea9aad92127
|
7
|
+
data.tar.gz: 71cbe80cc68b6730ba128c44a96767d94e8b56e5ae02328b5cb4667443ad0b316280562e8eca567039d413db841fe5583e0dd8626e993dd7c7fe5715371c8b36
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RorVsWild
|
2
|
+
module Plugin
|
3
|
+
class Middleware
|
4
|
+
def self.setup
|
5
|
+
return if @installed
|
6
|
+
Rails.application.config.middleware.unshift(RorVsWild::Plugin::Middleware, nil) if defined?(Rails)
|
7
|
+
@installed = true
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(app, config)
|
11
|
+
@app, @config = app, config
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
RorVsWild.agent.start_request
|
16
|
+
RorVsWild.agent.current_data[:path] = env["ORIGINAL_FULLPATH".freeze]
|
17
|
+
section = RorVsWild::Section.start
|
18
|
+
section.file, section.line = rails_engine_location
|
19
|
+
section.command = "Rails::Engine#call".freeze
|
20
|
+
@app.call(env)
|
21
|
+
ensure
|
22
|
+
RorVsWild::Section.stop
|
23
|
+
RorVsWild.agent.stop_request
|
24
|
+
end
|
25
|
+
|
26
|
+
def rails_engine_location
|
27
|
+
@rails_engine_location = ::Rails::Engine.instance_method(:call).source_location
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/rorvswild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Performances and quality insights for rails developers.
|
14
14
|
email:
|
@@ -39,7 +39,6 @@ files:
|
|
39
39
|
- lib/rorvswild/local/stylesheet/vendor/prism.css
|
40
40
|
- lib/rorvswild/locator.rb
|
41
41
|
- lib/rorvswild/plugin/action_controller.rb
|
42
|
-
- lib/rorvswild/plugin/action_dispatch.rb
|
43
42
|
- lib/rorvswild/plugin/action_mailer.rb
|
44
43
|
- lib/rorvswild/plugin/action_view.rb
|
45
44
|
- lib/rorvswild/plugin/active_job.rb
|
@@ -47,6 +46,7 @@ files:
|
|
47
46
|
- lib/rorvswild/plugin/delayed_job.rb
|
48
47
|
- lib/rorvswild/plugin/elasticsearch.rb
|
49
48
|
- lib/rorvswild/plugin/faktory.rb
|
49
|
+
- lib/rorvswild/plugin/middleware.rb
|
50
50
|
- lib/rorvswild/plugin/mongo.rb
|
51
51
|
- lib/rorvswild/plugin/net_http.rb
|
52
52
|
- lib/rorvswild/plugin/redis.rb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module RorVsWild
|
2
|
-
module Plugin
|
3
|
-
class ActionDispatch
|
4
|
-
def self.setup
|
5
|
-
return if @installed
|
6
|
-
return unless defined?(::ActiveSupport::Notifications)
|
7
|
-
ActiveSupport::Notifications.subscribe("request.action_dispatch", new)
|
8
|
-
@installed = true
|
9
|
-
end
|
10
|
-
|
11
|
-
def start(name, id, payload)
|
12
|
-
RorVsWild.agent.start_request
|
13
|
-
RorVsWild.agent.current_data[:path] = payload[:request].original_fullpath
|
14
|
-
@action_dispath_location ||= ::ActionDispatch::Executor.instance_method(:call).source_location
|
15
|
-
section = RorVsWild::Section.start
|
16
|
-
section.file, section.line = @action_dispath_location
|
17
|
-
section.command = "ActionDispatch::Executor.#call".freeze
|
18
|
-
section.kind = "code".freeze
|
19
|
-
end
|
20
|
-
|
21
|
-
def finish(name, id, payload)
|
22
|
-
RorVsWild::Section.stop
|
23
|
-
RorVsWild.agent.stop_request
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|