scout_apm 1.2.0.pre4 → 1.2.0.pre5
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/scout_apm/instruments/active_record.rb +2 -2
- data/lib/scout_apm/instruments/net_http.rb +4 -2
- data/lib/scout_apm/layer_converter.rb +3 -0
- data/lib/scout_apm/request_manager.rb +0 -2
- data/lib/scout_apm/slow_transaction.rb +1 -1
- data/lib/scout_apm/tracked_request.rb +1 -1
- data/lib/scout_apm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a680e8cef85b93d5e282713634ce64a5ebf7970b
|
4
|
+
data.tar.gz: 3c42708fb4709503fc4ac88281281ea1edf1757d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97276bcd2d071b2f1df7729712093e1cb20e79c4b49bb7b0a032e0bce6838963409a60872d4e5ffb3abf1d88aed1984e7a177e9db38e362b00c6476d6c17304f
|
7
|
+
data.tar.gz: 912b566fe6ca24b6045a8dc0b4dc094e4117d060843653806607acbd44f1d995269ee5df7aa5bc4c3ae6c6f48ed041d298c73c6ef8f8a93585c4ed0ca39664d2
|
@@ -58,7 +58,7 @@ module ScoutApm
|
|
58
58
|
|
59
59
|
def log_with_scout_instruments(*args, &block)
|
60
60
|
sql, name = args
|
61
|
-
self.class.instrument("ActiveRecord", scout_ar_metric_name(sql,name), :desc => Utils::SqlSanitizer.new(sql).to_s ) do
|
61
|
+
self.class.instrument("ActiveRecord", scout_ar_metric_name(sql, name), :desc => Utils::SqlSanitizer.new(sql).to_s ) do
|
62
62
|
log_without_scout_instruments(sql, name, &block)
|
63
63
|
end
|
64
64
|
end
|
@@ -66,7 +66,7 @@ module ScoutApm
|
|
66
66
|
def scout_ar_metric_name(sql, name)
|
67
67
|
# sql: SELECT "places".* FROM "places" ORDER BY "places"."position" ASC
|
68
68
|
# name: Place Load
|
69
|
-
if name && (parts = name.split
|
69
|
+
if name && (parts = name.split(" ")) && parts.size == 2
|
70
70
|
model = parts.first
|
71
71
|
operation = parts.last.downcase
|
72
72
|
metric_name = case operation
|
@@ -22,10 +22,12 @@ module ScoutApm
|
|
22
22
|
include ScoutApm::Tracer
|
23
23
|
|
24
24
|
def request_with_scout_instruments(*args,&block)
|
25
|
-
|
26
|
-
|
25
|
+
url = (@address + args.first.path.split('?').first)[0..99]
|
26
|
+
self.class.instrument("HTTP", "request", :desc => url) do
|
27
|
+
request_without_scout_instruments(*args, &block)
|
27
28
|
end
|
28
29
|
end
|
30
|
+
|
29
31
|
alias request_without_scout_instruments request
|
30
32
|
alias request request_with_scout_instruments
|
31
33
|
end
|
@@ -113,6 +113,9 @@ module ScoutApm
|
|
113
113
|
def create_metrics
|
114
114
|
metric_hash = Hash.new
|
115
115
|
|
116
|
+
# Keep a list of subscopes, but only ever use the front one. The rest
|
117
|
+
# get pushed/popped in cases when we have many levels of subscopable
|
118
|
+
# layers. This lets us push/pop without otherwise keeping track very closely.
|
116
119
|
subscope_layers = []
|
117
120
|
|
118
121
|
walker.before do |layer|
|
@@ -14,14 +14,12 @@ module ScoutApm
|
|
14
14
|
if req && req.recorded?
|
15
15
|
nil
|
16
16
|
else
|
17
|
-
ScoutApm::Agent.instance.logger.info("Found Existing Request")
|
18
17
|
req
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
22
21
|
# Create a new TrackedRequest object for this thread
|
23
22
|
def self.create
|
24
|
-
ScoutApm::Agent.instance.logger.info("Starting a new Request")
|
25
23
|
Thread.current[:scout_request] = TrackedRequest.new
|
26
24
|
end
|
27
25
|
end
|
@@ -2,7 +2,7 @@ module ScoutApm
|
|
2
2
|
class SlowTransaction
|
3
3
|
include ScoutApm::BucketNameSplitter
|
4
4
|
|
5
|
-
BACKTRACE_THRESHOLD = 0.
|
5
|
+
BACKTRACE_THRESHOLD = 0.1 # the minimum threshold to record the backtrace for a metric.
|
6
6
|
BACKTRACE_LIMIT = 5 # Max length of callers to display
|
7
7
|
MAX_SIZE = 100 # Limits the size of the metric hash to prevent a metric explosion.
|
8
8
|
|
@@ -52,7 +52,7 @@ module ScoutApm
|
|
52
52
|
layer.record_stop_time!
|
53
53
|
|
54
54
|
# Do this here, rather than in the layer because we need this caller. Maybe able to move it?
|
55
|
-
if layer.
|
55
|
+
if layer.total_exclusive_time > ScoutApm::SlowTransaction::BACKTRACE_THRESHOLD
|
56
56
|
layer.store_backtrace(ScoutApm::SlowTransaction.backtrace_parser(caller))
|
57
57
|
end
|
58
58
|
|
data/lib/scout_apm/version.rb
CHANGED