callstacking-rails 0.1.36 → 0.1.37
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8f0e31ee61913c798aa308ed0d92c76b8755cc0f6a884c0530792a23a0632e8
|
4
|
+
data.tar.gz: 04f3fe70825ec3f94c4d3b2d6c700cb55f457444376ffb066884a80ad4a5fb37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b90cd3642f0b451347aae60efe9174400c66c155d2d5f19b719b9a21c73f730c5a0a3748aa2d0d736c9f001d2e9027a070429a7653bb6e4aa112328fc7ee120
|
7
|
+
data.tar.gz: a42354436d3edbc0d8b02878731435f9b3b2f23b7281f011cae9b8fff8220750d4081fc75572595b132560c75d87de1f150df8a9fb8a4c8ace4f591f40f1af3b
|
@@ -5,16 +5,36 @@ module Callstacking
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
def callstacking_setup
|
7
7
|
exception = nil
|
8
|
+
@last_callstacking_sample = TIme.utc.now
|
8
9
|
Callstacking::Rails::Engine.start_tracing(self)
|
9
10
|
|
10
11
|
yield
|
11
12
|
rescue Exception => e
|
13
|
+
@last_callstacking_exception = Time.utc.now
|
12
14
|
exception = e
|
13
15
|
raise e
|
14
16
|
ensure
|
15
17
|
Callstacking::Rails::Engine.stop_tracing(self, exception)
|
16
18
|
end
|
17
19
|
end
|
20
|
+
|
21
|
+
def callstcking_sample_trace?
|
22
|
+
if @last_callstacking_exception.present? && @last_callstacking_exception < 1.minute.ago
|
23
|
+
@last_callstacking_exception = nil
|
24
|
+
return true
|
25
|
+
end
|
26
|
+
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
def callstacking_followup_exception_trace?
|
31
|
+
if @last_callstacking_sample.present? && @last_callstacking_sample < 1.hour.ago
|
32
|
+
@last_callstacking_exception = nil
|
33
|
+
return true
|
34
|
+
end
|
35
|
+
|
36
|
+
false
|
37
|
+
end
|
18
38
|
end
|
19
39
|
end
|
20
40
|
end
|
@@ -39,8 +39,8 @@ module Callstacking
|
|
39
39
|
|
40
40
|
method_name = __method__
|
41
41
|
|
42
|
-
path = method(__method__).super_method.source_location
|
43
|
-
line_no = method(__method__).super_method.source_location
|
42
|
+
path = method(__method__).super_method.source_location&.first || ''
|
43
|
+
line_no = method(__method__).super_method.source_location&.last || ''
|
44
44
|
|
45
45
|
p, l = caller.find { |c| c.to_s =~ /#{::Rails.root.to_s}/}&.split(':')
|
46
46
|
|
@@ -64,8 +64,8 @@ module Callstacking
|
|
64
64
|
|
65
65
|
method_name = __method__
|
66
66
|
|
67
|
-
path = method(__method__).super_method.source_location
|
68
|
-
line_no = method(__method__).super_method.source_location
|
67
|
+
path = method(__method__).super_method.source_location&.first || ''
|
68
|
+
line_no = method(__method__).super_method.source_location&.last || ''
|
69
69
|
|
70
70
|
p, l = caller.find { |c| c.to_s =~ /#{::Rails.root.to_s}/}&.split(':')
|
71
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: callstacking-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|