builder_apm 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02760fa88241646b4ddb87a554d821ecf18890d0e9c4d70dcceffd1b46b2778a
4
- data.tar.gz: 4ebd515ffcfad5572b968698223e1aafbe625c53bfb3c1a59540e9f6ba832933
3
+ metadata.gz: 2f9d7c7af0913b72c61b524ecc012de2bf7184cbeb0feeb42dbf61e6b7fb71d6
4
+ data.tar.gz: c4337273e42bec6234f1cb8c2987ab82a5dddb28ee150e179b3162d5d53ebdf5
5
5
  SHA512:
6
- metadata.gz: e9c141994b8b2afc5c623a88b8edc5138448ef34ed61405afd7f0d5f42454f1575366e73a179ef4a1819245818b060886474bdbeb38eec31bcd809443d63d357
7
- data.tar.gz: 516d69507027b4fd00edb38b79299cb92b30e6561442742b28e14c34f32efd53cc01c21fc7122a262fcce38d227fa21ddb1e8b1495f57fa5083662885e72f127
6
+ metadata.gz: 70c6b5cbe90f474260100e7d7c563a555f73cfe2f1f8072462f6e6934be7990ebf6c486b02d2b820b879c4fb65828abe86b0cc66b9dcc95348417a84ea051dbe
7
+ data.tar.gz: 3b8b18b6c41bacc1b3cfd0a0a6ca2f691f097d2ce495bc99583b0582a61c28d654443235982360e3912cf256448de817c8de6a679f1009b1b13a91cddd19912b
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module BuilderApm
2
- VERSION = "0.5.11"
2
+ VERSION = "0.5.12"
3
3
  end
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.11
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-09-27 00:00:00.000000000 Z
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails