app_profiler 0.3.0 → 0.4.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/backend/base_backend.rb +21 -2
- data/lib/app_profiler/backend/stackprof_backend.rb +0 -14
- data/lib/app_profiler/backend/vernier_backend.rb +0 -14
- data/lib/app_profiler/base_profile.rb +4 -0
- data/lib/app_profiler/version.rb +1 -1
- data/lib/app_profiler.rb +1 -0
- 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: b5ca2ed69abcd8cba935914ee16e8427fa8070fb3b0eecb488b06a027a64667a
|
4
|
+
data.tar.gz: fbcd17ddeeabfbbb8fe52c69d8744b0a8c73a9cd54ed6cd248f40e1c1a8f2662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41e6a149770dbffc1f85f3b280ef91cfc3c2ab966f6d9c8ce943c6c46e3ae2a2784b2864d2a8163593c83d0c116af1919598cc0576831423c5ed825a90b0770
|
7
|
+
data.tar.gz: d12e52408d4d5aedc048661bc96d35f55f038c1eeaedc01c6ed4b31612298d8203c33e5449d935a677a4ec3b75e0cc4c3cc938ae186a3a29c49d245da8093128
|
@@ -3,8 +3,27 @@
|
|
3
3
|
module AppProfiler
|
4
4
|
module Backend
|
5
5
|
class BaseBackend
|
6
|
-
def run(params = {}
|
7
|
-
|
6
|
+
def run(params = {})
|
7
|
+
started = start(params)
|
8
|
+
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
9
|
+
|
10
|
+
yield
|
11
|
+
|
12
|
+
return unless started
|
13
|
+
|
14
|
+
duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time
|
15
|
+
|
16
|
+
stop
|
17
|
+
results_data = results
|
18
|
+
|
19
|
+
if results_data
|
20
|
+
results_data.metadata[:duration] = duration
|
21
|
+
end
|
22
|
+
|
23
|
+
results_data
|
24
|
+
ensure
|
25
|
+
# Only stop the profiler if profiling was started in this context.
|
26
|
+
stop if started
|
8
27
|
end
|
9
28
|
|
10
29
|
def start(params = {})
|
@@ -22,20 +22,6 @@ module AppProfiler
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def run(params = {})
|
26
|
-
started = start(params)
|
27
|
-
|
28
|
-
yield
|
29
|
-
|
30
|
-
return unless started
|
31
|
-
|
32
|
-
stop
|
33
|
-
results
|
34
|
-
ensure
|
35
|
-
# Only stop the profiler if profiling was started in this context.
|
36
|
-
stop if started
|
37
|
-
end
|
38
|
-
|
39
25
|
def start(params = {})
|
40
26
|
# Do not start the profiler if StackProf was started somewhere else.
|
41
27
|
return false if running?
|
@@ -21,20 +21,6 @@ module AppProfiler
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def run(params = {})
|
25
|
-
started = start(params)
|
26
|
-
|
27
|
-
yield
|
28
|
-
|
29
|
-
return unless started
|
30
|
-
|
31
|
-
stop
|
32
|
-
results
|
33
|
-
ensure
|
34
|
-
# Only stop the profiler if profiling was started in this context.
|
35
|
-
stop if started
|
36
|
-
end
|
37
|
-
|
38
24
|
def start(params = {})
|
39
25
|
# Do not start the profiler if we already have a collector started somewhere else.
|
40
26
|
return false if running?
|
data/lib/app_profiler/version.rb
CHANGED
data/lib/app_profiler.rb
CHANGED
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.4.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: 2025-
|
15
|
+
date: 2025-04-10 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: 3.6.
|
204
|
+
rubygems_version: 3.6.6
|
205
205
|
specification_version: 4
|
206
206
|
summary: Collect performance profiles for your Rails application.
|
207
207
|
test_files: []
|