stoplight 5.8.2 → 5.8.3

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: ffd14a6cba96433a1bf1129ed7218923ae6abcf2b038adacfb811ca42aa1f358
4
- data.tar.gz: '0867e7091e8e74d7466e54a849d0a7c2b188489df408555370acba9fa1ddb4f0'
3
+ metadata.gz: fe8903aa5cfb542051938b5579384312614da2ffbb937b7eb0be6ce75ae71951
4
+ data.tar.gz: 5866c336e440464a53b0b7266a44494734c86574e80351bf9ec0406ee9c51f10
5
5
  SHA512:
6
- metadata.gz: 1a29c7ed961ab026f67b2b84edc8fbf96f134fdaa7c080b43494bda31d85248b3843c326bede1376cedfa8c1d047e88f297f6684d0e6a928129ab914b2139c25
7
- data.tar.gz: 077bea6b93b238d67431efd13f351c70ddad211ec4802d01eeab1672445829a0022f83b35a86928d20934a735834a2a8c5eaab364109cf81a9c88a4ec43d001d
6
+ metadata.gz: a27f2a8da1e01f183d13719efae03132ec938edc6bfaa575c916fa34a4b11da0071135e937d9de1763191a2c99ce2bed55092793b2413f482020ae626c46eac6
7
+ data.tar.gz: f77a6c5e858e4b8427a4bca1b09450ddbbc9b5aa4d11804167151c0efcfc8e7731f50a1c7e9b40952addb77fd08287c8948b98896ca97d45740e2882933665df
@@ -242,7 +242,7 @@ module Stoplight
242
242
 
243
243
  scripting.call(
244
244
  :record_failure,
245
- args: [current_ts, SecureRandom.hex(12), serialize_failure(failure), metrics_ttl, metadata_ttl],
245
+ args: [current_ts, SecureRandom.hex(12), serialize_failure(failure), metrics_ttl(config), metadata_ttl],
246
246
  keys: [
247
247
  metadata_key(config),
248
248
  config.window_size && errors_key(config, time: current_ts)
@@ -255,7 +255,7 @@ module Stoplight
255
255
 
256
256
  scripting.call(
257
257
  :record_success,
258
- args: [current_ts, request_id, metrics_ttl, metadata_ttl],
258
+ args: [current_ts, request_id, metrics_ttl(config), metadata_ttl],
259
259
  keys: [
260
260
  metadata_key(config),
261
261
  config.window_size && successes_key(config, time: current_ts)
@@ -481,8 +481,8 @@ module Stoplight
481
481
  METRICS_TTL = 86400 # 1 day
482
482
  private_constant :METRICS_TTL
483
483
 
484
- private def metrics_ttl
485
- METRICS_TTL
484
+ private def metrics_ttl(config)
485
+ config.window_size || METRICS_TTL
486
486
  end
487
487
 
488
488
  METADATA_TTL = 86400 * 7 # 7 days
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stoplight
4
- VERSION = Gem::Version.new("5.8.2")
4
+ VERSION = Gem::Version.new("5.8.3")
5
5
  end
@@ -57,7 +57,7 @@ module Stoplight
57
57
  private def errors_key: (Domain::Config config, time: Time) -> String
58
58
  private def recovery_metrics_key: (Domain::Config config) -> String
59
59
  private def metadata_key: (Domain::Config config) -> String
60
- private def metrics_ttl: -> Integer
60
+ private def metrics_ttl: (Domain::Config) -> Integer
61
61
  private def metadata_ttl: -> Integer
62
62
  private def detect_clock_skew: -> void
63
63
  private def should_sample?: (Float) -> bool
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stoplight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.2
4
+ version: 5.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Desautels