scout_apm 1.2.0.pre4 → 1.2.0.pre5

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
  SHA1:
3
- metadata.gz: f508603a89cdfe632705361cc8851ced50df895a
4
- data.tar.gz: 77d125f988caad68753566d2af1dcb83c39843f6
3
+ metadata.gz: a680e8cef85b93d5e282713634ce64a5ebf7970b
4
+ data.tar.gz: 3c42708fb4709503fc4ac88281281ea1edf1757d
5
5
  SHA512:
6
- metadata.gz: 2b32fc560600367eb019ea15d5053ecbb89d0e122e09202966aac54c013d5b42539ca4b571e8e24d48c5472dcc53bb1310cec8548d9ff04b9944ff17542f7c68
7
- data.tar.gz: 256eb11cc4a6db72b8c43046e0792d09053f0db0b9d4219987fe66aa15550cb00c1d5edf5b471541f7218be50abd82e37fe9fef9f7091b7b0e3220e682068b9b
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 " ") && parts.size == 2
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
- self.class.instrument("HTTP", "request", :annotate_layer => { :url => "#{(@address+args.first.path.split('?').first)[0..99]}" } ) do
26
- request_without_scout_instruments(*args,&block)
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 # the minimum threshold to record the backtrace for a metric.
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.total_call_time > ScoutApm::SlowTransaction::BACKTRACE_THRESHOLD
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
 
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "1.2.0.pre4"
2
+ VERSION = "1.2.0.pre5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.pre4
4
+ version: 1.2.0.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes