builder_apm 0.5.11 → 0.5.12
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f9d7c7af0913b72c61b524ecc012de2bf7184cbeb0feeb42dbf61e6b7fb71d6
|
|
4
|
+
data.tar.gz: c4337273e42bec6234f1cb8c2987ab82a5dddb28ee150e179b3162d5d53ebdf5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70c6b5cbe90f474260100e7d7c563a555f73cfe2f1f8072462f6e6934be7990ebf6c486b02d2b820b879c4fb65828abe86b0cc66b9dcc95348417a84ea051dbe
|
|
7
|
+
data.tar.gz: 3b8b18b6c41bacc1b3cfd0a0a6ca2f691f097d2ce495bc99583b0582a61c28d654443235982360e3912cf256448de817c8de6a679f1009b1b13a91cddd19912b
|
data/lib/builder_apm/engine.rb
CHANGED
|
@@ -5,6 +5,7 @@ module BuilderApm
|
|
|
5
5
|
initializer 'builder_apm.start' do |app|
|
|
6
6
|
BuilderApm::Controllers::Instrumenter.new.start
|
|
7
7
|
BuilderApm::Models::Instrumenter.start if BuilderApm.configuration.enable_active_record_profiler
|
|
8
|
+
BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
config.after_initialize do
|
|
@@ -21,7 +21,7 @@ module BuilderApm
|
|
|
21
21
|
me = self
|
|
22
22
|
TracePoint.new(:call, :return, :end, :raise) do |tp|
|
|
23
23
|
starttime = Time.now.to_f * 1000
|
|
24
|
-
me.process_trace_point(tp) if me.valid_trace_point?(tp)
|
|
24
|
+
me.process_trace_point(tp) if Thread.current[:request_id] && me.valid_trace_point?(tp)
|
|
25
25
|
duration = (Time.now.to_f * 1000) - starttime
|
|
26
26
|
|
|
27
27
|
Thread.current[:method_tracing] = (Thread.current[:method_tracing] ||= 0) + duration
|
|
@@ -30,7 +30,6 @@ module BuilderApm
|
|
|
30
30
|
|
|
31
31
|
def valid_trace_point?(tp)
|
|
32
32
|
return false unless tp.path.start_with?(@root_path)
|
|
33
|
-
return false unless Thread.current[:request_id]
|
|
34
33
|
|
|
35
34
|
start_controller = Thread.current[:stack]&.first
|
|
36
35
|
start_controller && "#{tp.defined_class}##{tp.method_id}" != start_controller[:method]
|
|
@@ -17,12 +17,10 @@ module BuilderApm
|
|
|
17
17
|
Thread.current[:db_tracing] = 0
|
|
18
18
|
Thread.current[:trace_point].disable if Thread.current[:trace_point]
|
|
19
19
|
Thread.current[:trace_point] = nil
|
|
20
|
-
BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler
|
|
21
20
|
|
|
22
21
|
@status, @headers, @response = @app.call(env)
|
|
23
22
|
|
|
24
23
|
ensure
|
|
25
|
-
Thread.current[:trace_point].disable if Thread.current[:trace_point]
|
|
26
24
|
end_time = Time.now.to_f * 1000
|
|
27
25
|
handle_timing(start_time, end_time, request_id)
|
|
28
26
|
|
data/lib/builder_apm/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: builder_apm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Ketelle
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-10-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|