app_profiler 0.4.0 → 0.5.0
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 +4 -4
- data/lib/app_profiler/railtie.rb +1 -0
- data/lib/app_profiler/request_parameters.rb +1 -1
- data/lib/app_profiler/version.rb +1 -1
- data/lib/app_profiler.rb +20 -10
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e510f0a0d20ec300e0ae5593adbdb03195202ea68e6a8ecad5fb13abfef9473
|
|
4
|
+
data.tar.gz: 66dd66baaa5e863a0b0311431da9ab17f794c3e8902e73b6d29f998c0867db74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67c22d47cea0a3fe91928495b4d14f476c727bd98c976bb7ae310b61b317c0a54dc91d350c870cc8cc155a044f33f49dfc5a1c739bd68609261af537c43b8913
|
|
7
|
+
data.tar.gz: 0e57a16a1bf6195fb8b723ae213e8fb2226a7858448420ef4e495363402033f1e9612971411981f505b9901dde425fc910d82023b788e1d60311d44ff3a0d258
|
data/lib/app_profiler/railtie.rb
CHANGED
|
@@ -34,6 +34,7 @@ module AppProfiler
|
|
|
34
34
|
)
|
|
35
35
|
AppProfiler.profile_header = app.config.app_profiler.profile_header || "X-Profile"
|
|
36
36
|
AppProfiler.profile_async_header = app.config.app_profiler.profile_async_header || "X-Profile-Async"
|
|
37
|
+
AppProfiler.profile_param = app.config.app_profiler.profile_param || "profile"
|
|
37
38
|
AppProfiler.profile_root = app.config.app_profiler.profile_root || Rails.root.join(
|
|
38
39
|
"tmp", "app_profiler"
|
|
39
40
|
)
|
data/lib/app_profiler/version.rb
CHANGED
data/lib/app_profiler.rb
CHANGED
|
@@ -41,15 +41,16 @@ module AppProfiler
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
autoload(:Middleware, "app_profiler/middleware")
|
|
44
|
-
autoload(:Parameters, "app_profiler/parameters")
|
|
45
|
-
autoload(:RequestParameters, "app_profiler/request_parameters")
|
|
46
44
|
autoload(:BaseProfile, "app_profiler/base_profile")
|
|
47
45
|
autoload :StackprofProfile, "app_profiler/stackprof_profile"
|
|
48
46
|
autoload :VernierProfile, "app_profiler/vernier_profile"
|
|
49
47
|
autoload(:Backend, "app_profiler/backend")
|
|
50
48
|
autoload(:Server, "app_profiler/server")
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
|
|
50
|
+
require "app_profiler/parameters"
|
|
51
|
+
require "app_profiler/request_parameters"
|
|
52
|
+
require "app_profiler/profile_id"
|
|
53
|
+
require "app_profiler/sampler"
|
|
53
54
|
|
|
54
55
|
mattr_accessor :logger, default: Logger.new($stdout)
|
|
55
56
|
mattr_accessor :root
|
|
@@ -59,6 +60,7 @@ module AppProfiler
|
|
|
59
60
|
mattr_accessor :autoredirect, default: false
|
|
60
61
|
mattr_reader :profile_header, default: "X-Profile"
|
|
61
62
|
mattr_accessor :profile_async_header, default: "X-Profile-Async"
|
|
63
|
+
mattr_accessor :profile_param, default: "profile"
|
|
62
64
|
mattr_accessor :context, default: nil
|
|
63
65
|
mattr_reader :profile_url_formatter, default: DefaultProfileFormatter
|
|
64
66
|
mattr_accessor :storage, default: Storage::FileStorage
|
|
@@ -90,9 +92,13 @@ module AppProfiler
|
|
|
90
92
|
end
|
|
91
93
|
profiler.run(*args, **kwargs, &block)
|
|
92
94
|
rescue BackendError => e
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if ActiveSupport.respond_to?(:error_reporter)
|
|
96
|
+
ActiveSupport.error_reporter.report(e, context: { app_profiler: { backend: backend } })
|
|
97
|
+
else
|
|
98
|
+
logger.error(
|
|
99
|
+
"[AppProfiler.run] exception #{e} configuring backend #{backend}: #{e.message}",
|
|
100
|
+
)
|
|
101
|
+
end
|
|
96
102
|
yield
|
|
97
103
|
ensure
|
|
98
104
|
self.backend = original_backend if backend
|
|
@@ -159,9 +165,13 @@ module AppProfiler
|
|
|
159
165
|
|
|
160
166
|
@profile_sampler_enabled.is_a?(Proc) ? @profile_sampler_enabled.call : @profile_sampler_enabled
|
|
161
167
|
rescue => e
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
if ActiveSupport.respond_to?(:error_reporter)
|
|
169
|
+
ActiveSupport.error_reporter.report(e)
|
|
170
|
+
else
|
|
171
|
+
logger.error(
|
|
172
|
+
"[AppProfiler.profile_sampler_enabled] exception: #{e}, message: #{e.message}",
|
|
173
|
+
)
|
|
174
|
+
end
|
|
165
175
|
false
|
|
166
176
|
end
|
|
167
177
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: app_profiler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gannon McGibbon
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
- Scott Francis
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date:
|
|
15
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activesupport
|
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
201
201
|
- !ruby/object:Gem::Version
|
|
202
202
|
version: '0'
|
|
203
203
|
requirements: []
|
|
204
|
-
rubygems_version:
|
|
204
|
+
rubygems_version: 4.0.6
|
|
205
205
|
specification_version: 4
|
|
206
206
|
summary: Collect performance profiles for your Rails application.
|
|
207
207
|
test_files: []
|