network_resiliency 0.7.4 → 0.7.5

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: 3774847314055bc429c64b7c01ff299f968381b17ba0cb127d51bac28191bac2
4
+ data.tar.gz: dd751faea35ee4239814fe97f3982978c2d46d48b327985112543eb54f33588b
5
5
  SHA512:
6
- metadata.gz: 27c263dfa4a022dc4b45813c04f9e50ffc6d3bebf7d6a7776599c9ba7eccfb0e0955979d7bdc7bd93bb1d3b09d2e119be4170546a08aa0be7153e83fa0753d2e
7
- data.tar.gz: 6bf9632a37139826fbba3c33ccf7f4b035679ae25b9fa132fa37e869c4b8d8c9006e287a8f6d45c98c2bd7af0f40e0d4324cdd80f86016e9c02ab832f770205d
6
+ metadata.gz: 74749461556b53fd3e3cbcbff1a01b5e96686018ad57987ef2812251cce2570155e42fbbca624f3b42d4ec2ddd79ecbb98ee8eeb71e773da4613f7ac6efbe6a5
7
+ data.tar.gz: 9a907626da9a9ad67ec59ccd50d59ed26f3fa2539dc92bdc82c7be4a7d767077de44c8621d24c703f6a3b30c1ce0d810e7e55f6944ce6b3aa908b54d696f7245
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v0.7.5 (2023-12-14)
2
+ - syncing stats
3
+ - stats cache
4
+
1
5
  ### v0.7.4 (2023-12-13)
2
6
  - increase dynamic timeouts
3
7
 
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.5)
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.5"
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(
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.5
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: 2023-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug