network_resiliency 0.7.4 → 0.7.6

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
  SHA256:
3
- metadata.gz: 89bb9051481420709c8f6003e40569d8c7936c131779c54c6b097e6ada55c3fb
4
- data.tar.gz: 2347d0f719549c5a15173e7728e73fac3960c0e73e021a8d2e130407ee10ddca
3
+ metadata.gz: 1638cc4c3d6d9bac433da17c88bff46f544e2047ce6e8c71c1e61eaa17def6ed
4
+ data.tar.gz: c5c72835476c0e2696827143a2a6923d8153fc805b36203f4e9b5d0c169b8f9c
5
5
  SHA512:
6
- metadata.gz: 27c263dfa4a022dc4b45813c04f9e50ffc6d3bebf7d6a7776599c9ba7eccfb0e0955979d7bdc7bd93bb1d3b09d2e119be4170546a08aa0be7153e83fa0753d2e
7
- data.tar.gz: 6bf9632a37139826fbba3c33ccf7f4b035679ae25b9fa132fa37e869c4b8d8c9006e287a8f6d45c98c2bd7af0f40e0d4324cdd80f86016e9c02ab832f770205d
6
+ metadata.gz: 775af81eb1c8edb15b94889b817e4f8b6e8904ac5e4a2c80c559feb0c174ab44eb30fe25fc884d1be4c96635644e37a7f1be2eeb9160418c1a846f513340ecc2
7
+ data.tar.gz: 812a5e7754f89e017396a60cd1692a350d1c47eb1a844e75525910d67dc1387698290025f5821c6a1de808402523ee390f7b424df3dd59166aa660a7e244613a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### v0.7.6 (2024-01-16)
2
+ - dynamic timeout logging fix
3
+
4
+ ### v0.7.5 (2023-12-14)
5
+ - syncing stats
6
+ - stats cache
7
+
1
8
  ### v0.7.4 (2023-12-13)
2
9
  - increase dynamic timeouts
3
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network_resiliency (0.7.4)
4
+ network_resiliency (0.7.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -154,12 +154,12 @@ module NetworkResiliency
154
154
  sq_dist = sq_dist + other_sq_dist
155
155
  sq_dist = sq_dist + (delta ^ 2) * prev_n * other_n / n
156
156
  end
157
- end
158
157
 
159
- -- update cache
160
- if n >= #{MIN_SAMPLE_SIZE} then
161
- cached_stats = string.format('%d|%f|%d', n, avg, sq_dist)
162
- redis.call('SET', cache_key, cached_stats, 'EX', #{CACHE_TTL})
158
+ -- update cache
159
+ if n >= #{MIN_SAMPLE_SIZE} then
160
+ cached_stats = string.format('%d|%f|%d', n, avg, sq_dist)
161
+ redis.call('SET', cache_key, cached_stats, 'EX', #{CACHE_TTL})
162
+ end
163
163
  end
164
164
 
165
165
  -- accumulate results
@@ -10,6 +10,10 @@ module NetworkResiliency
10
10
  @instance&.shutdown
11
11
  @instance = nil
12
12
  end
13
+
14
+ def syncing?
15
+ !!@instance&.alive?
16
+ end
13
17
  end
14
18
 
15
19
  def initialize(redis)
@@ -1,3 +1,3 @@
1
1
  module NetworkResiliency
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.6"
3
3
  end
@@ -264,6 +264,7 @@ module NetworkResiliency
264
264
  adapter: adapter,
265
265
  destination: destination,
266
266
  n: stats.n.order_of_magnitude,
267
+ sync: Syncer.syncing?,
267
268
  }
268
269
 
269
270
  NetworkResiliency.statsd&.distribution(
@@ -323,15 +324,6 @@ module NetworkResiliency
323
324
 
324
325
  p99 = (stats.avg + stats.stdev * 3).order_of_magnitude(ceil: true)
325
326
 
326
- NetworkResiliency.statsd&.distribution(
327
- "network_resiliency.#{action}.timeout.dynamic",
328
- p99,
329
- tags: {
330
- adapter: adapter,
331
- destination: destination,
332
- },
333
- )
334
-
335
327
  timeouts = []
336
328
 
337
329
  if max
@@ -375,6 +367,15 @@ module NetworkResiliency
375
367
  )
376
368
  end
377
369
 
370
+ NetworkResiliency.statsd&.distribution(
371
+ "network_resiliency.#{action}.timeout.dynamic",
372
+ timeouts[0],
373
+ tags: {
374
+ adapter: adapter,
375
+ destination: destination,
376
+ },
377
+ )
378
+
378
379
  case units
379
380
  when nil, :ms, :milliseconds
380
381
  timeouts
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.7.4
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug