network_resiliency 0.7.12 → 0.7.13

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: 93c15344f1a3f02c3ef567baeb1650745b27286a92db1975368a2066e29df423
4
- data.tar.gz: '092ee5a69a9f6b3e2e299946404c83353bb142e7d6d596d7fe4d556640500c5f'
3
+ metadata.gz: c006caf6d6fefeca3185a0a6a1d75be6bcf1cbc16ed9e1b00f2b147114b8442f
4
+ data.tar.gz: cad33936cc88b7d586b9b1ca92ab36308e37af11768509e67fb6f20e2af354ba
5
5
  SHA512:
6
- metadata.gz: 9a84c796661456dd272fa052647ec99991956f5d69435a8dd046a93634de0bbfdc5100cd7cb9b8dfb54d3641d18c71cb5b0728c70448ed6de40fa2bd181eb02e
7
- data.tar.gz: d9487add703cd5c2ef71abbed8d913619338e240faceaaeac8621c58dbfe2af6203029328f37875f75315d94f91498a6283e252f3c3703fefd12b546e46745c1
6
+ metadata.gz: e4eaf6bf8b4a4b176a8bd2ae3b79a80fc1a9b01c0d0a6dc486e870d656eb3793c1626dd923c2afd1c2b06774012067d77815a1710e5de44f06d79f098dd8db2b
7
+ data.tar.gz: 36d9406a01c76ca09d0859194401bbd49a177f644c1ca38d5df3c1fb8ad27907304d8d17ad2c165ced7dcfc67b467ee4e2061ce63e80a884fc8a5a372e994f2b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v0.7.13 (2024-03-04)
2
+ - downsampling
3
+ - redis resiliency
4
+
1
5
  ### v0.7.12 (2024-02-23)
2
6
  - improve metric sampling
3
7
  - lower resiliency threshold
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network_resiliency (0.7.12)
4
+ network_resiliency (0.7.13)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -50,7 +50,9 @@ module NetworkResiliency
50
50
  NetworkResiliency.redis.disconnect! if NetworkResiliency.redis.connected?
51
51
 
52
52
  until @shutdown
53
- StatsEngine.sync(NetworkResiliency.redis)
53
+ NetworkResiliency.redis.with_reconnect do
54
+ StatsEngine.sync(NetworkResiliency.redis)
55
+ end
54
56
 
55
57
  sleep(SLEEP_DURATION)
56
58
  end
@@ -1,3 +1,3 @@
1
1
  module NetworkResiliency
2
- VERSION = "0.7.12"
2
+ VERSION = "0.7.13"
3
3
  end
@@ -257,6 +257,12 @@ module NetworkResiliency
257
257
  # record stats
258
258
  key = [ adapter, action, destination ].join(":")
259
259
  stats = StatsEngine.add(key, duration)
260
+
261
+ if stats.n > RESILIENCY_SIZE_THRESHOLD * 4
262
+ # downsample to age out old stats
263
+ stats.scale!(50)
264
+ end
265
+
260
266
  tags = {
261
267
  adapter: adapter,
262
268
  destination: destination,
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.12
4
+ version: 0.7.13
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-02-23 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug