app_profiler 0.2.6 → 0.2.7
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/base_profile.rb +10 -6
- data/lib/app_profiler/railtie.rb +1 -0
- data/lib/app_profiler/version.rb +1 -1
- data/lib/app_profiler/viewer/firefox_viewer.rb +1 -1
- data/lib/app_profiler.rb +8 -2
- 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: 1d088d71f0d625a8627a17aa418840597b1d26e01bc05a93848440ce710f461a
|
4
|
+
data.tar.gz: 5f65cc77daaeaacbeed54cc913c08e89fddbc30e64458e1538c2cce2f5e9b381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a99c98c4bcf876d9c7147bf552b47ae5b8052f2e3c314a2279c8e34a2f37a9781f47c9f7ee99260281490682d1ea776f00be946494dd8fcd0bb83cbd5db07537
|
7
|
+
data.tar.gz: 4fafc43c3a589636928566a4bdf96fde0abf91eebde85e267852c281f7b5439ce76048c1cbca1cfe18119b99057bc7355fe41c2e48537c6b6a62f7a41b0ffa4b
|
@@ -96,12 +96,16 @@ module AppProfiler
|
|
96
96
|
private
|
97
97
|
|
98
98
|
def path
|
99
|
-
filename =
|
100
|
-
AppProfiler.
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
99
|
+
filename = if AppProfiler.profile_file_name.present?
|
100
|
+
AppProfiler.profile_file_name.call(metadata) + format
|
101
|
+
else
|
102
|
+
[
|
103
|
+
AppProfiler.profile_file_prefix.call,
|
104
|
+
mode,
|
105
|
+
id,
|
106
|
+
Socket.gethostname,
|
107
|
+
].compact.join("-") << format
|
108
|
+
end
|
105
109
|
|
106
110
|
raise UnsafeFilename if /[^0-9A-Za-z.\-\_]/.match?(filename)
|
107
111
|
|
data/lib/app_profiler/railtie.rb
CHANGED
@@ -42,6 +42,7 @@ module AppProfiler
|
|
42
42
|
AppProfiler.upload_queue_max_length = app.config.app_profiler.upload_queue_max_length || 10
|
43
43
|
AppProfiler.upload_queue_interval_secs = app.config.app_profiler.upload_queue_interval_secs || 5
|
44
44
|
AppProfiler.profile_file_prefix = app.config.app_profiler.profile_file_prefix || DefaultProfilePrefix
|
45
|
+
AppProfiler.profile_file_name = app.config.app_profiler.profile_file_name
|
45
46
|
AppProfiler.profile_enqueue_success = app.config.app_profiler.profile_enqueue_success
|
46
47
|
AppProfiler.profile_enqueue_failure = app.config.app_profiler.profile_enqueue_failure
|
47
48
|
AppProfiler.after_process_queue = app.config.app_profiler.after_process_queue
|
data/lib/app_profiler/version.rb
CHANGED
data/lib/app_profiler.rb
CHANGED
@@ -68,8 +68,8 @@ module AppProfiler
|
|
68
68
|
mattr_reader :profile_enqueue_failure, default: nil
|
69
69
|
mattr_reader :after_process_queue, default: nil
|
70
70
|
mattr_accessor :forward_metadata_on_upload, default: false
|
71
|
-
|
72
71
|
mattr_accessor :profile_sampler_config
|
72
|
+
mattr_reader :profile_file_name
|
73
73
|
|
74
74
|
class << self
|
75
75
|
def deprecator # :nodoc:
|
@@ -129,6 +129,12 @@ module AppProfiler
|
|
129
129
|
@@vernier_viewer ||= Viewer::FirefoxViewer # rubocop:disable Style/ClassVars
|
130
130
|
end
|
131
131
|
|
132
|
+
def profile_file_name=(value)
|
133
|
+
raise ArgumentError, "profile_file_name must be a proc" if value && !value.is_a?(Proc)
|
134
|
+
|
135
|
+
@@profile_file_name = value # rubocop:disable Style/ClassVars
|
136
|
+
end
|
137
|
+
|
132
138
|
def profile_sampler_enabled=(value)
|
133
139
|
if value.is_a?(Proc)
|
134
140
|
raise ArgumentError,
|
@@ -167,7 +173,7 @@ module AppProfiler
|
|
167
173
|
end
|
168
174
|
|
169
175
|
def vernier_supported?
|
170
|
-
RUBY_VERSION >= "3.2.1"
|
176
|
+
RUBY_VERSION >= "3.2.1" && defined?(AppProfiler::Backend::VernierBackend.name)
|
171
177
|
end
|
172
178
|
|
173
179
|
def profile_header=(profile_header)
|
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.2.
|
4
|
+
version: 0.2.7
|
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: 2025-01-
|
15
|
+
date: 2025-01-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
|
-
rubygems_version: 3.6.
|
189
|
+
rubygems_version: 3.6.3
|
190
190
|
specification_version: 4
|
191
191
|
summary: Collect performance profiles for your Rails application.
|
192
192
|
test_files: []
|