scout_apm 5.6.0 → 5.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46df05a2d67c23f243d1eedfddd2eabdd8a6151ef8974e185ea7c8efbe01d076
4
- data.tar.gz: 072bcd67b72f477c924dd647f2e3f87e586f3a97ff8dbbd727d5f5991c060f54
3
+ metadata.gz: 351ed300191874b86b1c402a2696897d05006266c2c88716a15d8588aefa00b2
4
+ data.tar.gz: dcdc4fb47007eb665f7a4df6a3a9a7bcde78550656692fc5023020739b0974d9
5
5
  SHA512:
6
- metadata.gz: 31ab64b2f5a212322989d118edba3f92cb4c4a223618bebd7f4fae318ebb243459dcd730388a080d7e7d6e0ce1147af857bb656f67bdeda902878e167f195f90
7
- data.tar.gz: 9191e3bf53423a7db1e9c0265a6b8cf03eb7bce0374ed392c137ab1c592dffee312c8efe8e6301e3a0fad17e033429af4c0b98b7608438be44251682236874d6
6
+ metadata.gz: 8fe62cd0646f58ad535d3912cf9c023fb8d7c52116dd30b3359e7f33f50f51ba3457090fe2df8f0bec5e5194b02bcccb44feaa466d76fa14938b91f11f1f74c0
7
+ data.tar.gz: cd20a788b47c33be24c8ee88eb00d443bf3d20990ba3fb769ca64353b14b090b931c121d6f07aa40bd366381f3f77646b41206e66cb9507cb204ee3eaadf62fe
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,8 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.6.1
4
+ - Fix `job_sample_rate` and `endpoint_sample_rate` default configuration values (#529)
5
+
3
6
  # 5.6.0
4
7
  - New options for sampling and ignore configurationn (#521)
5
8
  - `sample_rate` - Set the rate at which requests are sampled globally (1-100, a percentage of requests to keep).
@@ -184,6 +184,13 @@ module ScoutApm
184
184
  end
185
185
  end
186
186
 
187
+ class NullableIntegerCoercion
188
+ def coerce(val)
189
+ return val if val.nil?
190
+ val.to_i
191
+ end
192
+ end
193
+
187
194
  # Simply returns the passed in value, without change
188
195
  class NullCoercion
189
196
  def coerce(val)
@@ -213,8 +220,8 @@ module ScoutApm
213
220
  'sample_rate' => IntegerCoercion.new,
214
221
  'sample_endpoints' => JsonCoercion.new,
215
222
  'sample_jobs' => JsonCoercion.new,
216
- 'endpoint_sample_rate' => IntegerCoercion.new,
217
- 'job_sample_rate' => IntegerCoercion.new,
223
+ 'endpoint_sample_rate' => NullableIntegerCoercion.new,
224
+ 'job_sample_rate' => NullableIntegerCoercion.new,
218
225
  'start_resque_server_instrument' => BooleanCoercion.new,
219
226
  'timeline_traces' => BooleanCoercion.new,
220
227
  'auto_instruments' => BooleanCoercion.new,
@@ -337,8 +344,8 @@ module ScoutApm
337
344
  'sample_rate' => 100,
338
345
  'sample_endpoints' => [],
339
346
  'sample_jobs' => [],
340
- 'endpoint_sample_rate' => 100,
341
- 'job_sample_rate' => 100,
347
+ 'endpoint_sample_rate' => nil,
348
+ 'job_sample_rate' => nil,
342
349
  'start_resque_server_instrument' => true, # still only starts if Resque is detected
343
350
  'collect_remote_ip' => true,
344
351
  'record_queue_time' => true,
@@ -16,7 +16,15 @@ module ScoutApm
16
16
  @sample_jobs = individual_sample_to_hash(config.value('sample_jobs'))
17
17
  @job_sample_rate = config.value('job_sample_rate')
18
18
 
19
- logger.info("Sampling initialized with config: global_sample_rate: #{@global_sample_rate}, endpoint_sample_rate: #{@endpoint_sample_rate}, sample_endpoints: #{@sample_endpoints}, ignore_endpoints: #{@ignore_endpoints}, job_sample_rate: #@job_sample_rate}, sample_jobs: #{@sample_jobs}, ignore_jobs: #{@ignore_jobs}")
19
+ log_string = "Sampling initialized with config: "
20
+ log_string += "global_sample_rate: #{@global_sample_rate.inspect}, "
21
+ log_string += "endpoint_sample_rate: #{@endpoint_sample_rate.inspect}, "
22
+ log_string += "sample_endpoints: #{@sample_endpoints.inspect}, "
23
+ log_string += "ignore_endpoints: #{@ignore_endpoints.inspect}, "
24
+ log_string += "job_sample_rate: #{@job_sample_rate.inspect}, "
25
+ log_string += "sample_jobs: #{@sample_jobs.inspect}, "
26
+ log_string += "ignore_jobs: #{@ignore_jobs.inspect}"
27
+ logger.info(log_string)
20
28
  end
21
29
 
22
30
  def drop_request?(transaction)
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "5.6.0"
2
+ VERSION = "5.6.1"
3
3
  end
@@ -72,6 +72,26 @@ class ConfigTest < Minitest::Test
72
72
  assert_equal ["a"], coercion.coerce(["a"])
73
73
  end
74
74
 
75
+ def test_integer_coercion
76
+ coercion = ScoutApm::Config::IntegerCoercion.new
77
+ assert_equal 1, coercion.coerce("1")
78
+ assert_equal 1, coercion.coerce(1)
79
+ assert_equal 0, coercion.coerce("0")
80
+ assert_equal 0, coercion.coerce(0)
81
+ assert_equal 0, coercion.coerce("")
82
+ assert_equal 0, coercion.coerce(nil)
83
+ end
84
+
85
+ def test_nullable_integer_coercion
86
+ coercion = ScoutApm::Config::NullableIntegerCoercion.new
87
+ assert_equal 1, coercion.coerce("1")
88
+ assert_equal 1, coercion.coerce(1)
89
+ assert_equal 0, coercion.coerce("0")
90
+ assert_equal 0, coercion.coerce(0)
91
+ assert_equal 0, coercion.coerce("")
92
+ assert_equal nil, coercion.coerce(nil)
93
+ end
94
+
75
95
  def test_any_keys_found
76
96
  ENV.stubs(:has_key?).returns(nil)
77
97
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
8
8
  - Andre Lewis
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-15 00:00:00.000000000 Z
11
+ date: 2025-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest