scout_apm 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +7 -0
- data/lib/scout_apm/background_job_integrations/sidekiq.rb +7 -1
- data/lib/scout_apm/layaway.rb +21 -7
- data/lib/scout_apm/remote/server.rb +2 -0
- data/lib/scout_apm/version.rb +1 -1
- data/lib/scout_apm.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f02661ce9cf968ffd2fc3efdd96f81a82b49f05
|
4
|
+
data.tar.gz: 2f47f1ddebab08773b82679dad0f81a29442c7f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a809924c15851078d2f8e3ec820021b6ec018f767d08240d1481975a18747e27442c2742bc72be51692d5c35cf9a0d47188be6d386832bbd8d4bdb473a34d4
|
7
|
+
data.tar.gz: 9d4359d4285532afef1e043412459360430e7ec95392f9fa4a705e3b428d8bddcab953425d1cf23335a8cdd9e9ec39d1e4ce79ef1406208b6d62246b975d43d4
|
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 2.3.5
|
2
|
+
|
3
|
+
* More robust recovery from stale layaway files
|
4
|
+
* Quiet logging when hitting unusual layaway file limits
|
5
|
+
* Better naming for Sidekiq delayed method jobs
|
6
|
+
* Webrick is only required if actually needed
|
7
|
+
|
1
8
|
# 2.3.4
|
2
9
|
|
3
10
|
* Capture 300 characters of a url from net/http and httpclient instruments (up from 100).
|
@@ -92,10 +92,16 @@ module ScoutApm
|
|
92
92
|
end
|
93
93
|
elsif job_class == DELAYED_WRAPPER_KLASS
|
94
94
|
begin
|
95
|
+
# Extract the info out of the wrapper
|
95
96
|
yml = msg['args'].first
|
96
97
|
deserialized_args = YAML.load(yml)
|
97
98
|
klass, method, *rest = deserialized_args
|
98
|
-
|
99
|
+
|
100
|
+
# If this is an instance of a class, get the class itself
|
101
|
+
# Prevents instances from coming through named like "#<Foo:0x007ffd7a9dd8a0>"
|
102
|
+
klass = klass.class unless klass.is_a? Module
|
103
|
+
|
104
|
+
job_class = [klass, method].map(&:to_s).join(".")
|
99
105
|
rescue
|
100
106
|
DELAYED_WRAPPER_KLASS
|
101
107
|
end
|
data/lib/scout_apm/layaway.rb
CHANGED
@@ -50,7 +50,8 @@ module ScoutApm
|
|
50
50
|
|
51
51
|
def write_reporting_period(reporting_period, files_limit = MAX_FILES_LIMIT)
|
52
52
|
if at_layaway_file_limit?(files_limit)
|
53
|
-
|
53
|
+
# This will happen constantly once we hit this case, so only log the first time
|
54
|
+
@wrote_layaway_limit_error_message ||= ScoutApm::Agent.instance.logger.error("Hit layaway file limit. Not writing to layaway file")
|
54
55
|
return false
|
55
56
|
end
|
56
57
|
filename = file_for(reporting_period.timestamp)
|
@@ -58,9 +59,22 @@ module ScoutApm
|
|
58
59
|
layaway_file.write(reporting_period)
|
59
60
|
end
|
60
61
|
|
61
|
-
# Claims a given timestamp
|
62
|
-
#
|
63
|
-
#
|
62
|
+
# Claims a given timestamp by getting an exclusive lock on a timestamped
|
63
|
+
# coordinator file. The coordinator file never contains data, it's just a
|
64
|
+
# syncronization mechanism.
|
65
|
+
#
|
66
|
+
# Once the 'claim' is obtained:
|
67
|
+
# * load and yield each ReportingPeriod from the layaway files.
|
68
|
+
# * if there are reporting periods:
|
69
|
+
# * yields any ReportingPeriods collected up from all the files.
|
70
|
+
# * deletes all of the layaway files (including the coordinator) for the timestamp
|
71
|
+
# * if not
|
72
|
+
# * delete the coordinator
|
73
|
+
# * remove any stale layaway files that may be hanging around.
|
74
|
+
# * Finally unlock and ensure the coordinator file is cleared.
|
75
|
+
#
|
76
|
+
# If a claim file can't be obtained, return false without doing any work
|
77
|
+
# Another process is handling the reporting.
|
64
78
|
def with_claim(timestamp)
|
65
79
|
coordinator_file = glob_pattern(timestamp, :coordinator)
|
66
80
|
|
@@ -85,14 +99,14 @@ module ScoutApm
|
|
85
99
|
|
86
100
|
ScoutApm::Agent.instance.logger.debug("Deleting the now-reported layaway files for #{timestamp.to_s}")
|
87
101
|
delete_files_for(timestamp) # also removes the coodinator_file
|
88
|
-
|
89
|
-
ScoutApm::Agent.instance.logger.debug("Checking for any Stale layaway files")
|
90
|
-
delete_stale_files(timestamp.to_time - STALE_AGE)
|
91
102
|
else
|
92
103
|
File.unlink(coordinator_file)
|
93
104
|
ScoutApm::Agent.instance.logger.debug("No layaway files to report")
|
94
105
|
end
|
95
106
|
|
107
|
+
ScoutApm::Agent.instance.logger.debug("Checking for any Stale layaway files")
|
108
|
+
delete_stale_files(timestamp.to_time - STALE_AGE)
|
109
|
+
|
96
110
|
true
|
97
111
|
rescue Exception => e
|
98
112
|
ScoutApm::Agent.instance.logger.debug("Caught an exception in with_claim, with the coordination file locked: #{e.message}, #{e.backtrace.inspect}")
|
data/lib/scout_apm/version.rb
CHANGED
data/lib/scout_apm.rb
CHANGED
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: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Haynes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|