network_resiliency 0.8.1 → 0.8.2

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: 251e42c1b03eaa4cb6322a74da1f2b62ee0f08bc48112bd3c5858d1a9c888992
4
- data.tar.gz: 87fbd7883d8c3d1ae55287253c88a9f3375b3b8225e44e53ca9443cd27acde46
3
+ metadata.gz: 0aa3bd17753ae7b79982ef78ec1789f8f83ccbd540165b5600a8d68a521ced06
4
+ data.tar.gz: c7305e3f42e0229bf63ebc228def5ad136d07539050ea1cf6de21203e5d1656c
5
5
  SHA512:
6
- metadata.gz: 73a6fe0b5c7c3a97b9d8780c8bed84a8c4b18709dd569d11e13d3aa73a9356a86f0876d40b98e0a544bd8e2866c56062d2351035403e88a84e0ada602d6e2db1
7
- data.tar.gz: b7b7229f80aed636d7ac8fda9fe19a8ed415918f323822f0e42ee2c9be23b1594598005b23afaf87c1757745483ac5a9b20063773a99fd5471e7180b15e4481b
6
+ metadata.gz: b6202ad464c14c7632f2bc8b2220a1964a9065deeb0cf6a948bfdbe8e910449bb9f41a26101fa2b35df0a2282f0377a5886d7ca90c260fe98333ebe81b2217c6
7
+ data.tar.gz: 7aac06c18cb3a2301a7e47f1deae8da37cdbe9c1e975af15c501c150023319cf16225f62b2aae9646222f32a104720fd45a0544d82f9057bcf2f699a3dab19ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v0.8.2 (2024-03-13)
2
+ - revert ddog sampling
3
+ - Revert "lower secondary timeout"
4
+
1
5
  ### v0.8.1 (2024-03-12)
2
6
  - lower secondary timeout
3
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network_resiliency (0.8.1)
4
+ network_resiliency (0.8.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -65,13 +65,11 @@ module NetworkResiliency
65
65
  empty: data.empty?,
66
66
  truncated: data.size < dirty_keys.size,
67
67
  }.select { |_, v| v },
68
- sample_rate: SAMPLE_RATE[:sync],
69
68
  )
70
69
 
71
70
  NetworkResiliency.statsd&.distribution(
72
71
  "network_resiliency.sync.keys.dirty",
73
72
  dirty_keys.select { |_, n| n > 0 }.count,
74
- sample_rate: SAMPLE_RATE[:sync],
75
73
  )
76
74
 
77
75
  return [] if data.empty?
@@ -1,3 +1,3 @@
1
1
  module NetworkResiliency
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -22,11 +22,6 @@ module NetworkResiliency
22
22
  DEFAULT_TIMEOUT_MIN = 10 # ms
23
23
  MODE = [ :observe, :resilient ].freeze
24
24
  RESILIENCY_THRESHOLD = 100
25
- SAMPLE_RATE = {
26
- timeout: 0.1,
27
- stats: 0.1,
28
- sync: 0.1,
29
- }
30
25
 
31
26
  extend self
32
27
 
@@ -254,7 +249,6 @@ module NetworkResiliency
254
249
  adapter: adapter,
255
250
  destination: destination,
256
251
  },
257
- sample_rate: SAMPLE_RATE[:timeout],
258
252
  ) if timeout && timeout > 0
259
253
 
260
254
  if error
@@ -286,28 +280,23 @@ module NetworkResiliency
286
280
  # ensure Syncer is running
287
281
  Syncer.start
288
282
 
289
- if rand < SAMPLE_RATE[:stats]
290
- NetworkResiliency.statsd&.distribution(
291
- "network_resiliency.#{action}.stats.n",
292
- stats.n,
293
- tags: tags,
294
- sample_rate: SAMPLE_RATE[:stats],
295
- )
283
+ NetworkResiliency.statsd&.distribution(
284
+ "network_resiliency.#{action}.stats.n",
285
+ stats.n,
286
+ tags: tags,
287
+ )
296
288
 
297
- NetworkResiliency.statsd&.distribution(
298
- "network_resiliency.#{action}.stats.avg",
299
- stats.avg,
300
- tags: tags,
301
- sample_rate: SAMPLE_RATE[:stats],
302
- )
289
+ NetworkResiliency.statsd&.distribution(
290
+ "network_resiliency.#{action}.stats.avg",
291
+ stats.avg,
292
+ tags: tags,
293
+ )
303
294
 
304
- NetworkResiliency.statsd&.distribution(
305
- "network_resiliency.#{action}.stats.stdev",
306
- stats.stdev,
307
- tags: tags,
308
- sample_rate: SAMPLE_RATE[:stats],
309
- )
310
- end
295
+ NetworkResiliency.statsd&.distribution(
296
+ "network_resiliency.#{action}.stats.stdev",
297
+ stats.stdev,
298
+ tags: tags,
299
+ )
311
300
  end
312
301
 
313
302
  nil
@@ -361,16 +350,18 @@ module NetworkResiliency
361
350
 
362
351
  # make a second, more lenient attempt
363
352
 
364
- if p99 * 10 < max
365
- timeouts << p99 * 10
353
+ if p99 * 100 < max
354
+ timeouts << p99 * 100
355
+ elsif p99 * 10 < max
356
+ # use remaining time for second attempt
357
+ timeouts << max - p99
366
358
  else
367
359
  timeouts << max
368
360
 
369
361
  NetworkResiliency.statsd&.increment(
370
362
  "network_resiliency.timeout.raised",
371
363
  tags: tags,
372
- sample_rate: SAMPLE_RATE[:timeout],
373
- ) if rand < SAMPLE_RATE[:timeout]
364
+ )
374
365
  end
375
366
  else
376
367
  # the specified timeout is less than our expected p99...awkward
@@ -379,20 +370,18 @@ module NetworkResiliency
379
370
  NetworkResiliency.statsd&.increment(
380
371
  "network_resiliency.timeout.too_low",
381
372
  tags: tags,
382
- sample_rate: SAMPLE_RATE[:timeout],
383
- ) if rand < SAMPLE_RATE[:timeout]
373
+ )
384
374
  end
385
375
  else
386
376
  timeouts << p99
387
377
 
388
378
  # second attempt
389
- timeouts << p99 * 10
379
+ timeouts << p99 * 100
390
380
 
391
381
  NetworkResiliency.statsd&.increment(
392
382
  "network_resiliency.timeout.missing",
393
383
  tags: tags,
394
- sample_rate: SAMPLE_RATE[:timeout],
395
- ) if rand < SAMPLE_RATE[:timeout]
384
+ )
396
385
  end
397
386
 
398
387
  NetworkResiliency.statsd&.distribution(
@@ -402,8 +391,7 @@ module NetworkResiliency
402
391
  adapter: adapter,
403
392
  destination: destination,
404
393
  },
405
- sample_rate: SAMPLE_RATE[:timeout],
406
- ) if rand < SAMPLE_RATE[:timeout]
394
+ )
407
395
 
408
396
  case units
409
397
  when nil, :ms, :milliseconds
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network_resiliency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug