network_resiliency 0.8.0 → 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: a2a0b6dd58bb024a582f951fd5aa8105506a8c2ffee8dddac284128a09fc844a
4
- data.tar.gz: 7b978707f7788382cca10421190942c7395423d363eb222ddb0e5d1f5f1d734d
3
+ metadata.gz: 0aa3bd17753ae7b79982ef78ec1789f8f83ccbd540165b5600a8d68a521ced06
4
+ data.tar.gz: c7305e3f42e0229bf63ebc228def5ad136d07539050ea1cf6de21203e5d1656c
5
5
  SHA512:
6
- metadata.gz: ae2e38bf103409e575f31245634fca438992e9a50415b5c1d0bfa16e75016513a378ad2f0a9c2adef3c22a6392ef2ed1d9da67c26fff745b799bad2c83806e74
7
- data.tar.gz: aad0e97f32f64ecb254ee5095375119bf0ff307ab578a7566280e93994c6a59ea3eb3d135a2e1a89bef4ae3f90d4ab94af149dd274594c9f1bcda76f777c2b0e
6
+ metadata.gz: b6202ad464c14c7632f2bc8b2220a1964a9065deeb0cf6a948bfdbe8e910449bb9f41a26101fa2b35df0a2282f0377a5886d7ca90c260fe98333ebe81b2217c6
7
+ data.tar.gz: 7aac06c18cb3a2301a7e47f1deae8da37cdbe9c1e975af15c501c150023319cf16225f62b2aae9646222f32a104720fd45a0544d82f9057bcf2f699a3dab19ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### v0.8.2 (2024-03-13)
2
+ - revert ddog sampling
3
+ - Revert "lower secondary timeout"
4
+
5
+ ### v0.8.1 (2024-03-12)
6
+ - lower secondary timeout
7
+
1
8
  ### v0.8.0 (2024-03-12)
2
9
  - secondary timeout
3
10
  - cover http socket error
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network_resiliency (0.8.0)
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.0"
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
@@ -362,20 +351,17 @@ module NetworkResiliency
362
351
  # make a second, more lenient attempt
363
352
 
364
353
  if p99 * 100 < max
365
- # max is excessively high
366
354
  timeouts << p99 * 100
367
355
  elsif p99 * 10 < max
368
356
  # use remaining time for second attempt
369
357
  timeouts << max - p99
370
358
  else
371
- # max is smallish
372
359
  timeouts << max
373
360
 
374
361
  NetworkResiliency.statsd&.increment(
375
362
  "network_resiliency.timeout.raised",
376
363
  tags: tags,
377
- sample_rate: SAMPLE_RATE[:timeout],
378
- ) if rand < SAMPLE_RATE[:timeout]
364
+ )
379
365
  end
380
366
  else
381
367
  # the specified timeout is less than our expected p99...awkward
@@ -384,8 +370,7 @@ module NetworkResiliency
384
370
  NetworkResiliency.statsd&.increment(
385
371
  "network_resiliency.timeout.too_low",
386
372
  tags: tags,
387
- sample_rate: SAMPLE_RATE[:timeout],
388
- ) if rand < SAMPLE_RATE[:timeout]
373
+ )
389
374
  end
390
375
  else
391
376
  timeouts << p99
@@ -396,8 +381,7 @@ module NetworkResiliency
396
381
  NetworkResiliency.statsd&.increment(
397
382
  "network_resiliency.timeout.missing",
398
383
  tags: tags,
399
- sample_rate: SAMPLE_RATE[:timeout],
400
- ) if rand < SAMPLE_RATE[:timeout]
384
+ )
401
385
  end
402
386
 
403
387
  NetworkResiliency.statsd&.distribution(
@@ -407,8 +391,7 @@ module NetworkResiliency
407
391
  adapter: adapter,
408
392
  destination: destination,
409
393
  },
410
- sample_rate: SAMPLE_RATE[:timeout],
411
- ) if rand < SAMPLE_RATE[:timeout]
394
+ )
412
395
 
413
396
  case units
414
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.0
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