stoplight 5.8.3 → 6.0.0.rc2
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 +4 -4
- data/CHANGELOG.md +1 -1
- data/LICENSE.md +1 -0
- data/README.md +132 -79
- data/UPGRADING.md +265 -6
- data/lib/stoplight/admin/actions/action.rb +4 -12
- data/lib/stoplight/admin/actions/lock.rb +12 -9
- data/lib/stoplight/admin/actions/lock_all.rb +27 -0
- data/lib/stoplight/admin/actions/remove.rb +12 -9
- data/lib/stoplight/admin/actions/stats.rb +15 -12
- data/lib/stoplight/admin/actions/unlock.rb +10 -9
- data/lib/stoplight/admin/assets/apple-touch-icon.png +0 -0
- data/lib/stoplight/admin/assets/favicon.ico +0 -0
- data/lib/stoplight/admin/assets/flowbite.min.css +2 -0
- data/lib/stoplight/admin/assets/flowbite.min.js +1 -0
- data/lib/stoplight/admin/assets/icon.svg +7 -0
- data/lib/stoplight/admin/assets/turbo.es2017-esm.min.js +34 -0
- data/lib/stoplight/admin/config_registry.rb +40 -0
- data/lib/stoplight/admin/dependencies.rb +29 -28
- data/lib/stoplight/admin/helpers.rb +50 -17
- data/lib/stoplight/admin/light_view.rb +184 -0
- data/lib/stoplight/admin/lights_stats.rb +7 -9
- data/lib/stoplight/admin/views/_card.erb +19 -21
- data/lib/stoplight/admin/views/index.erb +9 -3
- data/lib/stoplight/admin/views/layout.erb +45 -13
- data/lib/stoplight/admin.rb +110 -21
- data/lib/stoplight/data_store.rb +18 -8
- data/lib/stoplight/domain/config.rb +4 -1
- data/lib/stoplight/domain/error_tracking_policy.rb +9 -0
- data/lib/stoplight/domain/failure.rb +4 -0
- data/lib/stoplight/domain/id.rb +13 -0
- data/lib/stoplight/domain/light.rb +35 -77
- data/lib/stoplight/domain/lock_control.rb +55 -0
- data/lib/stoplight/domain/matcher_validator.rb +24 -0
- data/lib/stoplight/domain/state_snapshot.rb +2 -6
- data/lib/stoplight/domain/strategies/green_run_strategy.rb +33 -19
- data/lib/stoplight/domain/strategies/red_run_strategy.rb +8 -2
- data/lib/stoplight/domain/strategies/yellow_run_strategy.rb +56 -32
- data/lib/stoplight/domain/telemetry/bus.rb +90 -0
- data/lib/stoplight/domain/telemetry/consumer.rb +18 -0
- data/lib/stoplight/domain/telemetry/emitter.rb +45 -0
- data/lib/stoplight/domain/telemetry/envelope.rb +15 -0
- data/lib/stoplight/domain/telemetry/failure.rb +13 -0
- data/lib/stoplight/domain/telemetry/light_registered.rb +12 -0
- data/lib/stoplight/domain/telemetry/lock_changed.rb +19 -0
- data/lib/stoplight/domain/telemetry/metrics.rb +15 -0
- data/lib/stoplight/domain/telemetry/recovery_failed.rb +20 -0
- data/lib/stoplight/domain/telemetry/recovery_probe_completed.rb +15 -0
- data/lib/stoplight/domain/telemetry/recovery_started.rb +18 -0
- data/lib/stoplight/domain/telemetry/recovery_succeeded.rb +19 -0
- data/lib/stoplight/domain/telemetry/run_completed.rb +17 -0
- data/lib/stoplight/domain/telemetry/run_recorder.rb +58 -0
- data/lib/stoplight/domain/telemetry/settings.rb +21 -0
- data/lib/stoplight/domain/telemetry/state_transitioned.rb +11 -0
- data/lib/stoplight/domain/telemetry/subscription.rb +11 -0
- data/lib/stoplight/domain/telemetry/traffic_breached.rb +20 -0
- data/lib/stoplight/domain/tracker/recovery_probe.rb +61 -17
- data/lib/stoplight/domain/tracker/request.rb +17 -8
- data/lib/stoplight/domain/traffic_control/consecutive_errors.rb +13 -3
- data/lib/stoplight/domain/traffic_control/error_rate.rb +16 -12
- data/lib/stoplight/domain/traffic_recovery/consecutive_successes.rb +9 -3
- data/lib/stoplight/error.rb +10 -1
- data/lib/stoplight/infrastructure/config_serializer.rb +50 -0
- data/lib/stoplight/infrastructure/fail_safe/error_notifier.rb +25 -0
- data/lib/stoplight/infrastructure/fail_safe/storage/registry.rb +68 -0
- data/lib/stoplight/infrastructure/memory/storage/registry.rb +18 -0
- data/lib/stoplight/infrastructure/memory/storage/unbounded_metrics.rb +29 -32
- data/lib/stoplight/infrastructure/memory/storage/window_metrics/sliding_window.rb +74 -0
- data/lib/stoplight/infrastructure/memory/storage/window_metrics.rb +25 -24
- data/lib/stoplight/infrastructure/notifier/fail_safe.rb +3 -8
- data/lib/stoplight/infrastructure/notifier/generic.rb +3 -3
- data/lib/stoplight/infrastructure/redis/key.rb +25 -0
- data/lib/stoplight/infrastructure/redis/storage/now.lua +9 -0
- data/lib/stoplight/infrastructure/redis/storage/recovery_lock.rb +2 -4
- data/lib/stoplight/infrastructure/redis/storage/recovery_metrics.rb +1 -1
- data/lib/stoplight/infrastructure/redis/storage/registry.rb +73 -0
- data/lib/stoplight/infrastructure/redis/storage/scripting.rb +54 -3
- data/lib/stoplight/infrastructure/redis/storage/state/transition_to_green.lua +3 -1
- data/lib/stoplight/infrastructure/redis/storage/state/transition_to_red.lua +4 -2
- data/lib/stoplight/infrastructure/redis/storage/state/transition_to_yellow.lua +3 -1
- data/lib/stoplight/infrastructure/redis/storage/state.rb +8 -8
- data/lib/stoplight/infrastructure/redis/storage/unbounded_metrics/record_failure.lua +20 -21
- data/lib/stoplight/infrastructure/redis/storage/unbounded_metrics/record_success.lua +11 -19
- data/lib/stoplight/infrastructure/redis/storage/unbounded_metrics.rb +20 -16
- data/lib/stoplight/infrastructure/redis/storage/window_metrics/_evict.lua +44 -0
- data/lib/stoplight/infrastructure/redis/storage/window_metrics/metrics_snapshot.lua +14 -21
- data/lib/stoplight/infrastructure/redis/storage/window_metrics/record_failure.lua +38 -36
- data/lib/stoplight/infrastructure/redis/storage/window_metrics/record_success.lua +23 -30
- data/lib/stoplight/infrastructure/redis/storage/window_metrics.rb +45 -135
- data/lib/stoplight/infrastructure/system_clock.rb +4 -0
- data/lib/stoplight/telemetry.rb +19 -0
- data/lib/stoplight/types.rb +15 -2
- data/lib/stoplight/version.rb +1 -1
- data/lib/stoplight/wiring/config_compatibility_validator.rb +25 -2
- data/lib/stoplight/wiring/default.rb +1 -1
- data/lib/stoplight/wiring/default_config.rb +2 -1
- data/lib/stoplight/wiring/default_configuration.rb +3 -2
- data/lib/stoplight/wiring/external_caller.rb +27 -0
- data/lib/stoplight/wiring/fail_safe_config.rb +11 -0
- data/lib/stoplight/wiring/global_state.rb +93 -0
- data/lib/stoplight/wiring/{light_factory → light_configuration_dsl}/traffic_control_dsl.rb +3 -5
- data/lib/stoplight/wiring/{light_factory → light_configuration_dsl}/traffic_recovery_dsl.rb +2 -2
- data/lib/stoplight/wiring/light_configuration_dsl.rb +97 -0
- data/lib/stoplight/wiring/light_factory.rb +154 -97
- data/lib/stoplight/wiring/notifier_bridge.rb +33 -0
- data/lib/stoplight/wiring/redis/backend.rb +1 -1
- data/lib/stoplight/wiring/system/storage.rb +69 -0
- data/lib/stoplight/wiring/system.rb +125 -56
- data/lib/stoplight/wiring/{configuration_dsl.rb → system_configuration_dsl.rb} +13 -43
- data/lib/stoplight.rb +50 -194
- data/sig/sinatra/base.rbs +6 -0
- data/sig/stdlib/securerandom.rbs +4 -0
- data/sig/stoplight/admin/actions/action.rbs +10 -0
- data/sig/stoplight/admin/actions/lock.rbs +17 -0
- data/sig/stoplight/admin/actions/lock_all.rbs +17 -0
- data/sig/stoplight/admin/actions/remove.rbs +22 -0
- data/sig/stoplight/admin/actions/stats.rbs +28 -0
- data/sig/stoplight/admin/actions/unlock.rbs +17 -0
- data/sig/stoplight/admin/config_registry.rbs +20 -0
- data/sig/stoplight/admin/dependencies.rbs +16 -0
- data/sig/stoplight/admin/helpers.rbs +17 -0
- data/sig/stoplight/admin/light_view.rbs +39 -0
- data/sig/stoplight/admin/lights_stats.rbs +30 -0
- data/sig/stoplight/admin.rbs +14 -0
- data/sig/stoplight/color.rbs +3 -3
- data/sig/{_private/stoplight/data_store.rbs → stoplight/data_store/base.rbs} +1 -0
- data/sig/stoplight/data_store/memory.rbs +9 -0
- data/sig/stoplight/data_store/redis.rbs +17 -0
- data/sig/{_private/stoplight → stoplight}/domain/config.rbs +28 -24
- data/sig/{_private/stoplight → stoplight}/domain/error_tracking_policy.rbs +4 -0
- data/sig/{_private/stoplight → stoplight}/domain/failure.rbs +2 -0
- data/sig/stoplight/domain/id.rbs +7 -0
- data/sig/stoplight/domain/light.rbs +39 -0
- data/sig/{_private/stoplight → stoplight}/domain/light_info.rbs +1 -5
- data/sig/stoplight/domain/lock_control.rbs +16 -0
- data/sig/stoplight/domain/matcher_validator.rbs +11 -0
- data/sig/{_private/stoplight → stoplight}/domain/ports/clock.rbs +6 -0
- data/sig/stoplight/domain/ports/data_store.rbs +9 -0
- data/sig/stoplight/domain/ports/error_notifier.rbs +12 -0
- data/sig/stoplight/domain/ports/exception_matcher.rbs +10 -0
- data/sig/{_private/stoplight → stoplight}/domain/ports/metrics_store.rbs +2 -2
- data/sig/stoplight/domain/ports/registry.rbs +13 -0
- data/sig/{_private/stoplight → stoplight}/domain/ports/run_strategy.rbs +2 -1
- data/sig/stoplight/domain/ports/state_transition_notifier.rbs +18 -0
- data/sig/stoplight/domain/ports/telemetry.rbs +28 -0
- data/sig/stoplight/domain/ports/telemetry_publisher.rbs +14 -0
- data/sig/{_private/stoplight → stoplight}/domain/ports/traffic_control.rbs +7 -0
- data/sig/{_private/stoplight → stoplight}/domain/ports/traffic_recovery.rbs +2 -3
- data/sig/stoplight/domain/strategies/green_run_strategy.rbs +22 -0
- data/sig/stoplight/domain/strategies/red_run_strategy.rbs +19 -0
- data/sig/{_private/stoplight → stoplight}/domain/strategies/yellow_run_strategy.rbs +23 -12
- data/sig/stoplight/domain/telemetry/bus.rbs +49 -0
- data/sig/stoplight/domain/telemetry/consumer.rbs +13 -0
- data/sig/stoplight/domain/telemetry/emitter.rbs +51 -0
- data/sig/stoplight/domain/telemetry/envelope.rbs +30 -0
- data/sig/stoplight/domain/telemetry/failure.rbs +23 -0
- data/sig/stoplight/domain/telemetry/light_registered.rbs +23 -0
- data/sig/stoplight/domain/telemetry/lock_changed.rbs +31 -0
- data/sig/stoplight/domain/telemetry/metrics.rbs +27 -0
- data/sig/stoplight/domain/telemetry/recovery_failed.rbs +36 -0
- data/sig/stoplight/domain/telemetry/recovery_probe_completed.rbs +29 -0
- data/sig/stoplight/domain/telemetry/recovery_started.rbs +26 -0
- data/sig/stoplight/domain/telemetry/recovery_succeeded.rbs +31 -0
- data/sig/stoplight/domain/telemetry/run_completed.rbs +38 -0
- data/sig/stoplight/domain/telemetry/run_recorder.rbs +27 -0
- data/sig/stoplight/domain/telemetry/settings.rbs +47 -0
- data/sig/stoplight/domain/telemetry/state_transitioned.rbs +11 -0
- data/sig/stoplight/domain/telemetry/subscription.rbs +9 -0
- data/sig/stoplight/domain/telemetry/traffic_breached.rbs +36 -0
- data/sig/stoplight/domain/telemetry/types.rbs +32 -0
- data/sig/{_private/stoplight → stoplight}/domain/tracker/recovery_probe.rbs +10 -6
- data/sig/{_private/stoplight → stoplight}/domain/tracker/request.rbs +3 -3
- data/sig/{_private/stoplight → stoplight}/domain/traffic_control/consecutive_errors.rbs +2 -0
- data/sig/{_private/stoplight → stoplight}/domain/traffic_control/error_rate.rbs +3 -2
- data/sig/{_private/stoplight → stoplight}/domain/traffic_recovery/consecutive_successes.rbs +2 -0
- data/sig/stoplight/domain/types.rbs +25 -0
- data/sig/stoplight/error.rbs +8 -0
- data/sig/stoplight/generators/rails_generators_base.rbs +11 -0
- data/sig/stoplight/infrastructure/config_serializer.rbs +12 -0
- data/sig/stoplight/infrastructure/fail_safe/error_notifier.rbs +13 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/fail_safe/storage/metrics.rbs +2 -2
- data/sig/{_private/stoplight → stoplight}/infrastructure/fail_safe/storage/recovery_lock.rbs +2 -2
- data/sig/stoplight/infrastructure/fail_safe/storage/registry.rbs +23 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/fail_safe/storage/state.rbs +4 -4
- data/sig/stoplight/infrastructure/memory/storage/registry.rbs +13 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/state.rbs +3 -3
- data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/unbounded_metrics.rbs +7 -7
- data/sig/stoplight/infrastructure/memory/storage/window_metrics/sliding_window.rbs +27 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/window_metrics.rbs +7 -7
- data/sig/stoplight/infrastructure/notifier/fail_safe.rbs +15 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/notifier/generic.rbs +1 -1
- data/sig/{_private/stoplight → stoplight}/infrastructure/notifier/io.rbs +1 -1
- data/sig/{_private/stoplight → stoplight}/infrastructure/notifier/logger.rbs +1 -1
- data/sig/stoplight/infrastructure/redis/key.rbs +10 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/recovery_lock.rbs +2 -2
- data/sig/stoplight/infrastructure/redis/storage/registry.rbs +27 -0
- data/sig/stoplight/infrastructure/redis/storage/scripting.rbs +34 -0
- data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/state.rbs +4 -4
- data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/unbounded_metrics.rbs +8 -1
- data/sig/stoplight/infrastructure/redis/storage/window_metrics.rbs +35 -0
- data/sig/stoplight/infrastructure/types.rbs +6 -0
- data/sig/stoplight/notifier.rbs +1 -1
- data/sig/stoplight/ports/system.rbs +16 -10
- data/sig/stoplight/state.rbs +3 -3
- data/sig/stoplight/telemetry.rbs +17 -0
- data/sig/stoplight/types.rbs +9 -0
- data/sig/{_private/stoplight → stoplight}/wiring/config_compatibility_validator.rbs +2 -0
- data/sig/stoplight/wiring/default.rbs +26 -0
- data/sig/stoplight/wiring/default_configuration.rbs +39 -0
- data/sig/stoplight/wiring/external_caller.rbs +13 -0
- data/sig/stoplight/wiring/fail_safe_config.rbs +7 -0
- data/sig/stoplight/wiring/global_state.rbs +36 -0
- data/sig/{_private/stoplight/wiring/light_factory → stoplight/wiring/light_configuration_dsl}/traffic_control_dsl.rbs +1 -1
- data/sig/{_private/stoplight/wiring/light_factory → stoplight/wiring/light_configuration_dsl}/traffic_recovery_dsl.rbs +1 -1
- data/sig/stoplight/wiring/light_configuration_dsl.rbs +38 -0
- data/sig/stoplight/wiring/light_factory.rbs +78 -0
- data/sig/stoplight/wiring/notifier_bridge.rbs +15 -0
- data/sig/stoplight/wiring/notifier_factory.rbs +10 -0
- data/sig/{_private/stoplight → stoplight}/wiring/redis/backend.rbs +6 -6
- data/sig/stoplight/wiring/system/storage.rbs +35 -0
- data/sig/stoplight/wiring/system.rbs +30 -0
- data/sig/stoplight/wiring/system_configuration_dsl.rbs +39 -0
- data/sig/stoplight/wiring/types.rbs +6 -0
- data/sig/stoplight.rbs +37 -54
- metadata +190 -143
- data/lib/stoplight/admin/actions/lock_all_green.rb +0 -18
- data/lib/stoplight/admin/actions/lock_green.rb +0 -23
- data/lib/stoplight/admin/actions/lock_red.rb +0 -23
- data/lib/stoplight/admin/lights_repository/light.rb +0 -171
- data/lib/stoplight/admin/lights_repository.rb +0 -87
- data/lib/stoplight/domain/light/configuration_builder_interface.rb +0 -236
- data/lib/stoplight/infrastructure/fail_safe/data_store.rb +0 -152
- data/lib/stoplight/infrastructure/memory/data_store/metrics.rb +0 -27
- data/lib/stoplight/infrastructure/memory/data_store/recovery_lock_store.rb +0 -52
- data/lib/stoplight/infrastructure/memory/data_store/recovery_lock_token.rb +0 -17
- data/lib/stoplight/infrastructure/memory/data_store/sliding_window.rb +0 -74
- data/lib/stoplight/infrastructure/memory/data_store/state.rb +0 -21
- data/lib/stoplight/infrastructure/memory/data_store.rb +0 -342
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/get_metrics.lua +0 -26
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/record_failure.lua +0 -36
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/record_recovery_probe_failure.lua +0 -27
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/record_recovery_probe_success.lua +0 -23
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/record_success.lua +0 -35
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/release_lock.lua +0 -6
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/transition_to_green.lua +0 -10
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/transition_to_red.lua +0 -10
- data/lib/stoplight/infrastructure/redis/data_store/lua_scripts/transition_to_yellow.lua +0 -9
- data/lib/stoplight/infrastructure/redis/data_store/recovery_lock_store.rb +0 -60
- data/lib/stoplight/infrastructure/redis/data_store/recovery_lock_token.rb +0 -28
- data/lib/stoplight/infrastructure/redis/data_store/scripting.rb +0 -73
- data/lib/stoplight/infrastructure/redis/data_store.rb +0 -516
- data/lib/stoplight/infrastructure/redis/storage/key_space.rb +0 -51
- data/lib/stoplight/infrastructure/storage/compatibility_metrics.rb +0 -41
- data/lib/stoplight/infrastructure/storage/compatibility_recovery_lock.rb +0 -33
- data/lib/stoplight/infrastructure/storage/compatibility_recovery_metrics.rb +0 -47
- data/lib/stoplight/infrastructure/storage/compatibility_state.rb +0 -44
- data/lib/stoplight/wiring/light_builder.rb +0 -198
- data/lib/stoplight/wiring/notifier_factory.rb +0 -26
- data/lib/stoplight/wiring/system/light_builder.rb +0 -47
- data/lib/stoplight/wiring/system/light_factory.rb +0 -64
- data/sig/_private/stoplight/domain/light.rbs +0 -25
- data/sig/_private/stoplight/domain/ports/data_store.rbs +0 -76
- data/sig/_private/stoplight/domain/ports/light_factory.rbs +0 -80
- data/sig/_private/stoplight/domain/strategies/green_run_strategy.rbs +0 -17
- data/sig/_private/stoplight/domain/strategies/red_run_strategy.rbs +0 -17
- data/sig/_private/stoplight/domain/tracker/base.rbs +0 -8
- data/sig/_private/stoplight/infrastructure/fail_safe/data_store.rbs +0 -26
- data/sig/_private/stoplight/infrastructure/memory/data_store/metrics.rbs +0 -25
- data/sig/_private/stoplight/infrastructure/memory/data_store/recovery_lock_store.rbs +0 -19
- data/sig/_private/stoplight/infrastructure/memory/data_store/recovery_lock_token.rbs +0 -17
- data/sig/_private/stoplight/infrastructure/memory/data_store/sliding_window.rbs +0 -27
- data/sig/_private/stoplight/infrastructure/memory/data_store/state.rbs +0 -17
- data/sig/_private/stoplight/infrastructure/memory/data_store.rbs +0 -30
- data/sig/_private/stoplight/infrastructure/notifier/fail_safe.rbs +0 -17
- data/sig/_private/stoplight/infrastructure/redis/data_store/recovery_lock_store.rbs +0 -24
- data/sig/_private/stoplight/infrastructure/redis/data_store/recovery_lock_token.rbs +0 -21
- data/sig/_private/stoplight/infrastructure/redis/data_store/scripting.rbs +0 -34
- data/sig/_private/stoplight/infrastructure/redis/data_store.rbs +0 -67
- data/sig/_private/stoplight/infrastructure/redis/storage/key_space.rbs +0 -19
- data/sig/_private/stoplight/infrastructure/redis/storage/scripting.rbs +0 -13
- data/sig/_private/stoplight/infrastructure/redis/storage/window_metrics.rbs +0 -34
- data/sig/_private/stoplight/infrastructure/storage/compatibility_metrics.rbs +0 -17
- data/sig/_private/stoplight/infrastructure/storage/compatibility_recovery_lock.rbs +0 -13
- data/sig/_private/stoplight/infrastructure/storage/compatibility_recovery_metrics.rbs +0 -14
- data/sig/_private/stoplight/infrastructure/storage/compatibility_state.rbs +0 -14
- data/sig/_private/stoplight/system/light_builder.rbs +0 -23
- data/sig/_private/stoplight/system/light_factory.rbs +0 -17
- data/sig/_private/stoplight/types.rbs +0 -6
- data/sig/_private/stoplight/wiring/configuration_dsl.rbs +0 -43
- data/sig/_private/stoplight/wiring/default.rbs +0 -26
- data/sig/_private/stoplight/wiring/default_configuration.rbs +0 -29
- data/sig/_private/stoplight/wiring/light_builder.rbs +0 -48
- data/sig/_private/stoplight/wiring/light_factory.rbs +0 -16
- data/sig/_private/stoplight/wiring/notifier_factory.rbs +0 -10
- data/sig/_private/stoplight/wiring/system.rbs +0 -15
- data/sig/_private/stoplight.rbs +0 -48
- data/sig/stoplight/data_store.rbs +0 -19
- data/sig/stoplight/ports/configuration.rbs +0 -19
- data/sig/stoplight/ports/exception_matcher.rbs +0 -8
- data/sig/stoplight/ports/light.rbs +0 -12
- data/sig/stoplight/ports/light_info.rbs +0 -5
- data/sig/stoplight/ports/state_transition_notifier.rbs +0 -15
- /data/sig/{_private/stoplight → stoplight}/common/deprecations.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/compatibility_result.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/metrics_snapshot.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/ports/recovery_lock_store.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/ports/recovery_lock_token.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/ports/state_store.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/state_snapshot.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/storage/recovery_lock_token.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/domain/traffic_recovery.rbs +0 -0
- /data/sig/{_private → stoplight}/generators/stoplight/install/install_generator.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/fail_safe/storage/recovery_lock_token.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/recovery_lock.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/recovery_metrics.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/metrics.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/recovery_metrics.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/infrastructure/system_clock.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/wiring/data_store_backend.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/wiring/default_config.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/wiring/memory/backend.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/wiring/storage_set.rbs +0 -0
- /data/sig/{_private/stoplight → stoplight}/wiring/storage_set_builder.rbs +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Domain
|
|
3
|
-
# Abstract factory protocol for building +Stoplight::Light+ instances.
|
|
4
|
-
#
|
|
5
|
-
# This defines the interface that any Light factory must implement,
|
|
6
|
-
# regardless of the underlying implementation details.
|
|
7
|
-
#
|
|
8
|
-
# This uses the Abstract Factory pattern to decouple the domain (Light)
|
|
9
|
-
# from the application layer (concrete factory implementation). Light
|
|
10
|
-
# doesn't know HOW it's built, only that it needs something that can
|
|
11
|
-
# build variants of itself.
|
|
12
|
-
#
|
|
13
|
-
# By defining this interface in the domain layer:
|
|
14
|
-
# - Light can request reconfiguration without knowing about containers
|
|
15
|
-
# - Different factory implementations can be swapped (code, database-configured, etc.)
|
|
16
|
-
# - Dependency direction is preserved (Application → Domain, not Domain → Application)
|
|
17
|
-
#
|
|
18
|
-
interface _LightFactory
|
|
19
|
-
# Creates a new factory with modified settings.
|
|
20
|
-
#
|
|
21
|
-
# This method must return a NEW factory instance - it should not
|
|
22
|
-
# modify the current factory. The new factory should inherit all
|
|
23
|
-
# configuration from the current factory, with the provided
|
|
24
|
-
# settings overriding specific values.
|
|
25
|
-
def with: (
|
|
26
|
-
?name: optional[String],
|
|
27
|
-
?cool_off_time: optional[duration],
|
|
28
|
-
?threshold: optional[percentage | Integer],
|
|
29
|
-
?recovery_threshold: optional[Integer],
|
|
30
|
-
?window_size: optional[duration?],
|
|
31
|
-
?tracked_errors: optional[Array[_ExceptionMatcher] | _ExceptionMatcher],
|
|
32
|
-
?skipped_errors: optional[Array[_ExceptionMatcher] | _ExceptionMatcher],
|
|
33
|
-
?error_notifier: optional[error_notifier],
|
|
34
|
-
?notifiers: optional[Array[state_transition_notifier]],
|
|
35
|
-
?data_store: optional[data_store],
|
|
36
|
-
?traffic_control: optional[traffic_control],
|
|
37
|
-
?traffic_recovery: optional[traffic_recovery],
|
|
38
|
-
) -> _LightFactory
|
|
39
|
-
|
|
40
|
-
# Builds a Light instance with the current configuration.
|
|
41
|
-
#
|
|
42
|
-
# This method must construct a fully-wired Light with all required
|
|
43
|
-
# dependencies (strategies, data store, notifiers, etc.). The Light
|
|
44
|
-
# should be ready to use immediately after construction.
|
|
45
|
-
#
|
|
46
|
-
# @raise [Stoplight::Error::ConfigurationError] If configuration is invalid
|
|
47
|
-
def build: -> Light
|
|
48
|
-
|
|
49
|
-
# Convenience method to configure and build in one operation.
|
|
50
|
-
#
|
|
51
|
-
# This combines +#with+ and +#build+ into a single call, which is
|
|
52
|
-
# useful when you want to create a customized Light without keeping
|
|
53
|
-
# a reference to the intermediate factory.
|
|
54
|
-
#
|
|
55
|
-
# @example Usage
|
|
56
|
-
# # Instead of:
|
|
57
|
-
# new_factory = factory.with(threshold: 10)
|
|
58
|
-
# light = new_factory.build
|
|
59
|
-
#
|
|
60
|
-
# # You can do:
|
|
61
|
-
# light = factory.build_with(threshold: 10)
|
|
62
|
-
def build_with: (
|
|
63
|
-
?name: optional[String],
|
|
64
|
-
?cool_off_time: optional[duration],
|
|
65
|
-
?threshold: optional[percentage | Integer],
|
|
66
|
-
?recovery_threshold: optional[Integer],
|
|
67
|
-
?window_size: optional[duration?],
|
|
68
|
-
?tracked_errors: optional[Array[_ExceptionMatcher] | _ExceptionMatcher],
|
|
69
|
-
?skipped_errors: optional[Array[_ExceptionMatcher] | _ExceptionMatcher],
|
|
70
|
-
?error_notifier: optional[error_notifier],
|
|
71
|
-
?notifiers: optional[Array[state_transition_notifier]],
|
|
72
|
-
?data_store: optional[data_store],
|
|
73
|
-
?traffic_control: optional[traffic_control],
|
|
74
|
-
?traffic_recovery: optional[traffic_recovery],
|
|
75
|
-
) -> Light
|
|
76
|
-
|
|
77
|
-
def ==: (untyped) -> bool
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Domain
|
|
3
|
-
module Strategies
|
|
4
|
-
class GreenRunStrategy
|
|
5
|
-
include _RunStrategy
|
|
6
|
-
|
|
7
|
-
attr_reader request_tracker: Tracker::Request
|
|
8
|
-
@error_tracking_policy: ErrorTrackingPolicy
|
|
9
|
-
|
|
10
|
-
def initialize: (error_tracking_policy: ErrorTrackingPolicy, request_tracker: Tracker::Request) -> void
|
|
11
|
-
|
|
12
|
-
def record_error: (StandardError) -> void
|
|
13
|
-
def record_success: -> void
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Domain
|
|
3
|
-
module Strategies
|
|
4
|
-
class RedRunStrategy
|
|
5
|
-
include _RunStrategy
|
|
6
|
-
|
|
7
|
-
@name: String
|
|
8
|
-
@cool_off_time: duration
|
|
9
|
-
|
|
10
|
-
def initialize: (name: String, cool_off_time: duration) -> void
|
|
11
|
-
|
|
12
|
-
private def record_error: (StandardError) -> void
|
|
13
|
-
private def record_success: -> void
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module FailSafe
|
|
4
|
-
class DataStore
|
|
5
|
-
include Domain::_DataStore
|
|
6
|
-
attr_reader data_store: Domain::_DataStore
|
|
7
|
-
attr_reader failover_data_store: Domain::_DataStore
|
|
8
|
-
attr_reader error_notifier: error_notifier
|
|
9
|
-
private attr_reader circuit_breaker: Domain::Light
|
|
10
|
-
|
|
11
|
-
def initialize: (
|
|
12
|
-
data_store: Domain::_DataStore,
|
|
13
|
-
error_notifier: error_notifier,
|
|
14
|
-
failover_data_store: Domain::_DataStore,
|
|
15
|
-
circuit_breaker: Domain::Light
|
|
16
|
-
) -> void
|
|
17
|
-
|
|
18
|
-
private def with_fallback: [T] (
|
|
19
|
-
String | Symbol method_name,
|
|
20
|
-
*untyped,
|
|
21
|
-
**untyped,
|
|
22
|
-
) { () -> T } -> T
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Stoplight
|
|
4
|
-
module Infrastructure
|
|
5
|
-
module Memory
|
|
6
|
-
class DataStore
|
|
7
|
-
class Metrics
|
|
8
|
-
attr_accessor consecutive_errors: Integer
|
|
9
|
-
attr_accessor consecutive_successes: Integer
|
|
10
|
-
attr_accessor last_error: Domain::Failure?
|
|
11
|
-
attr_accessor last_success_at: Time?
|
|
12
|
-
|
|
13
|
-
def initialize: (
|
|
14
|
-
?consecutive_errors: Integer,
|
|
15
|
-
?consecutive_successes: Integer,
|
|
16
|
-
?last_error: Domain::Failure?,
|
|
17
|
-
?last_success_at: Time?
|
|
18
|
-
) -> void
|
|
19
|
-
|
|
20
|
-
def last_error_at: -> Time?
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Memory
|
|
4
|
-
class DataStore
|
|
5
|
-
class RecoveryLockStore
|
|
6
|
-
private attr_reader locks: Concurrent::Map[String, Mutex]
|
|
7
|
-
|
|
8
|
-
def initialize: -> void
|
|
9
|
-
|
|
10
|
-
def acquire_lock: (String light_name) -> RecoveryLockToken?
|
|
11
|
-
|
|
12
|
-
def release_lock: (RecoveryLockToken recovery_lock_token) -> void
|
|
13
|
-
|
|
14
|
-
private def lock_for: (String light_name) -> Mutex
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Stoplight
|
|
4
|
-
module Infrastructure
|
|
5
|
-
module Memory
|
|
6
|
-
class DataStore
|
|
7
|
-
class RecoveryLockToken
|
|
8
|
-
include Domain::_RecoveryLockToken
|
|
9
|
-
|
|
10
|
-
attr_reader light_name: String
|
|
11
|
-
|
|
12
|
-
def initialize: (light_name: String) -> void
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Memory
|
|
4
|
-
class DataStore
|
|
5
|
-
class SlidingWindow
|
|
6
|
-
private attr_reader buckets: Hash[Integer, Integer]
|
|
7
|
-
private attr_accessor running_sum: Integer
|
|
8
|
-
private attr_reader clock: Domain::_Clock
|
|
9
|
-
|
|
10
|
-
def initialize: (clock: Domain::_Clock) -> void
|
|
11
|
-
|
|
12
|
-
def increment: -> void
|
|
13
|
-
|
|
14
|
-
def sum_in_window: (Time window_start) -> Integer
|
|
15
|
-
|
|
16
|
-
private def slide_window!: (Time window_start) -> void
|
|
17
|
-
|
|
18
|
-
private def current_bucket: -> Integer
|
|
19
|
-
|
|
20
|
-
private def bucket_for_time: (Time time) -> Integer
|
|
21
|
-
|
|
22
|
-
def inspect: -> String
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Stoplight
|
|
4
|
-
module Infrastructure
|
|
5
|
-
module Memory
|
|
6
|
-
class DataStore
|
|
7
|
-
class State
|
|
8
|
-
attr_accessor recovered_at: Time?
|
|
9
|
-
attr_accessor locked_state: state
|
|
10
|
-
attr_accessor recovery_scheduled_after: Time?
|
|
11
|
-
attr_accessor recovery_started_at: Time?
|
|
12
|
-
attr_accessor breached_at: Time?
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Memory
|
|
4
|
-
class DataStore
|
|
5
|
-
include Domain::_DataStore
|
|
6
|
-
include MonitorMixin
|
|
7
|
-
|
|
8
|
-
KEY_SEPARATOR: String
|
|
9
|
-
|
|
10
|
-
@errors: Hash[String, SlidingWindow]
|
|
11
|
-
@successes: Hash[String, SlidingWindow]
|
|
12
|
-
@metrics: Hash[String, Metrics]
|
|
13
|
-
@recovery_metrics: Hash[String, Metrics]
|
|
14
|
-
@states: Hash[String, State]
|
|
15
|
-
|
|
16
|
-
private attr_reader recovery_lock_store: RecoveryLockStore
|
|
17
|
-
private attr_reader clock: Domain::_Clock
|
|
18
|
-
|
|
19
|
-
def initialize: (
|
|
20
|
-
recovery_lock_store: RecoveryLockStore,
|
|
21
|
-
clock: Domain::_Clock
|
|
22
|
-
) -> void
|
|
23
|
-
|
|
24
|
-
private def transition_to_green: (Domain::Config config) -> bool
|
|
25
|
-
private def transition_to_yellow: (Domain::Config config) -> bool
|
|
26
|
-
private def transition_to_red: (Domain::Config config) -> bool
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Notifier
|
|
4
|
-
class FailSafe
|
|
5
|
-
include _StateTransitionNotifier
|
|
6
|
-
|
|
7
|
-
attr_reader notifier: state_transition_notifier
|
|
8
|
-
attr_reader error_notifier: error_notifier
|
|
9
|
-
@circuit_breaker: Domain::Light?
|
|
10
|
-
|
|
11
|
-
def initialize: (notifier: state_transition_notifier, error_notifier: error_notifier) -> void
|
|
12
|
-
|
|
13
|
-
private def circuit_breaker: -> Domain::Light
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
class DataStore
|
|
5
|
-
class RecoveryLockStore
|
|
6
|
-
attr_reader redis: redis
|
|
7
|
-
|
|
8
|
-
attr_reader lock_timeout: Integer
|
|
9
|
-
attr_reader scripting: Scripting
|
|
10
|
-
|
|
11
|
-
def initialize: (
|
|
12
|
-
redis: redis,
|
|
13
|
-
lock_timeout: Integer,
|
|
14
|
-
scripting: Scripting
|
|
15
|
-
) -> void
|
|
16
|
-
|
|
17
|
-
def acquire_lock: (String light_name) -> RecoveryLockToken?
|
|
18
|
-
|
|
19
|
-
def release_lock: (RecoveryLockToken recovery_lock) -> void
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
class DataStore
|
|
5
|
-
class RecoveryLockToken
|
|
6
|
-
include Domain::_RecoveryLockToken
|
|
7
|
-
|
|
8
|
-
attr_reader light_name: String
|
|
9
|
-
|
|
10
|
-
attr_reader token: String
|
|
11
|
-
|
|
12
|
-
def initialize: (light_name: String) -> void
|
|
13
|
-
|
|
14
|
-
def lock_key: -> String
|
|
15
|
-
|
|
16
|
-
private def key: (*_ToS) -> String
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
class DataStore
|
|
5
|
-
class Scripting
|
|
6
|
-
SCRIPTS_ROOT: String
|
|
7
|
-
|
|
8
|
-
def self.default_scripts_root: -> String
|
|
9
|
-
|
|
10
|
-
attr_reader scripts_root: String
|
|
11
|
-
|
|
12
|
-
attr_reader shas: Hash[interned, String]
|
|
13
|
-
|
|
14
|
-
attr_reader redis: redis
|
|
15
|
-
|
|
16
|
-
def initialize: (
|
|
17
|
-
redis: redis,
|
|
18
|
-
?scripts_root: String,
|
|
19
|
-
) -> void
|
|
20
|
-
|
|
21
|
-
def call: (
|
|
22
|
-
interned script_name,
|
|
23
|
-
?keys: Array[_ToS],
|
|
24
|
-
?args: Array[_ToS]
|
|
25
|
-
) -> untyped
|
|
26
|
-
|
|
27
|
-
private def reload_script: (interned script_name) -> String
|
|
28
|
-
|
|
29
|
-
private def script_sha: (interned script_name) -> String
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
class DataStore
|
|
5
|
-
include Domain::_DataStore
|
|
6
|
-
|
|
7
|
-
BUCKET_SIZE: Integer
|
|
8
|
-
KEY_SEPARATOR: String
|
|
9
|
-
KEY_PREFIX: String
|
|
10
|
-
METRICS_TTL: Integer
|
|
11
|
-
METADATA_TTL: Integer
|
|
12
|
-
SKEW_TOLERANCE: Integer
|
|
13
|
-
METRICS_RETENTION_TIME: Integer
|
|
14
|
-
|
|
15
|
-
def self.key: (*_ToS) -> String
|
|
16
|
-
|
|
17
|
-
def self.buckets_for_window: (
|
|
18
|
-
String light_name,
|
|
19
|
-
metric: String,
|
|
20
|
-
window_end: Time | Numeric,
|
|
21
|
-
window_size: Integer
|
|
22
|
-
) -> Array[String]
|
|
23
|
-
|
|
24
|
-
def self.bucket_key: (
|
|
25
|
-
String light_name,
|
|
26
|
-
metric: String,
|
|
27
|
-
time: Time | Numeric,
|
|
28
|
-
) -> String
|
|
29
|
-
|
|
30
|
-
def self.bucket_size: -> Integer
|
|
31
|
-
|
|
32
|
-
private attr_reader recovery_lock_store: RecoveryLockStore
|
|
33
|
-
private attr_reader scripting: Scripting
|
|
34
|
-
private attr_reader redis: redis
|
|
35
|
-
private attr_reader warn_on_clock_skew: bool
|
|
36
|
-
private attr_reader clock: Domain::_Clock
|
|
37
|
-
|
|
38
|
-
def initialize: (
|
|
39
|
-
redis: redis,
|
|
40
|
-
recovery_lock_store: RecoveryLockStore,
|
|
41
|
-
scripting: Scripting,
|
|
42
|
-
warn_on_clock_skew: bool,
|
|
43
|
-
clock: Domain::_Clock
|
|
44
|
-
) -> void
|
|
45
|
-
|
|
46
|
-
private def transition_to_green: (Domain::Config config) -> bool
|
|
47
|
-
private def transition_to_yellow: (Domain::Config config) -> bool
|
|
48
|
-
private def transition_to_red: (Domain::Config config) -> bool
|
|
49
|
-
private def deserialize_failure: (String? failure_json) -> Domain::Failure?
|
|
50
|
-
private def serialize_failure: (Domain::Failure failure) -> String
|
|
51
|
-
private def key: (*String) -> String
|
|
52
|
-
private def failure_bucket_keys: (Domain::Config config, window_end: Time | Integer) -> Array[String]
|
|
53
|
-
private def success_bucket_keys: (Domain::Config config, window_end: Time | Integer) -> Array[String]
|
|
54
|
-
private def recovery_probe_failure_bucket_keys: (Domain::Config config, window_end: Time | Integer) -> Array[String]
|
|
55
|
-
private def recovery_probe_success_bucket_keys: (Domain::Config config, window_end: Time | Integer) -> Array[String]
|
|
56
|
-
private def successes_key: (Domain::Config config, time: Time) -> String
|
|
57
|
-
private def errors_key: (Domain::Config config, time: Time) -> String
|
|
58
|
-
private def recovery_metrics_key: (Domain::Config config) -> String
|
|
59
|
-
private def metadata_key: (Domain::Config config) -> String
|
|
60
|
-
private def metrics_ttl: (Domain::Config) -> Integer
|
|
61
|
-
private def metadata_ttl: -> Integer
|
|
62
|
-
private def detect_clock_skew: -> void
|
|
63
|
-
private def should_sample?: (Float) -> bool
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
module Storage
|
|
5
|
-
class KeySpace
|
|
6
|
-
def system_id: -> String
|
|
7
|
-
def light_id: -> String
|
|
8
|
-
|
|
9
|
-
def self.build: (system_name: _ToS, light_name: _ToS) -> KeySpace
|
|
10
|
-
|
|
11
|
-
def self.hash_name: (_ToS) -> String
|
|
12
|
-
|
|
13
|
-
def initialize: (system_id: String, light_id: String) -> void
|
|
14
|
-
def key: (*_ToS) -> String
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Redis
|
|
4
|
-
module Storage
|
|
5
|
-
class WindowMetrics < Metrics
|
|
6
|
-
attr_reader config: Domain::Config
|
|
7
|
-
attr_reader redis: redis
|
|
8
|
-
attr_reader scripting: Scripting
|
|
9
|
-
attr_reader metrics_key: String
|
|
10
|
-
attr_reader clock: Domain::_Clock
|
|
11
|
-
attr_reader key_space: KeySpace
|
|
12
|
-
@window_size: Integer
|
|
13
|
-
|
|
14
|
-
def initialize: (
|
|
15
|
-
redis: redis,
|
|
16
|
-
scripting: Scripting,
|
|
17
|
-
config: Domain::Config,
|
|
18
|
-
clock: Domain::_Clock,
|
|
19
|
-
key_space: KeySpace
|
|
20
|
-
) -> void
|
|
21
|
-
|
|
22
|
-
def bucket_key: (metric: Symbol, time: _ToI) -> String
|
|
23
|
-
def bucket_size: -> Integer
|
|
24
|
-
def bucket_ttl: -> Integer
|
|
25
|
-
def buckets_for_window: (metric: Symbol, window_end: _ToI) -> Array[String]
|
|
26
|
-
def successes_key: (time: _ToI) -> String
|
|
27
|
-
def errors_key: (time: _ToI) -> String
|
|
28
|
-
def failure_bucket_keys: (_ToI window_end) -> Array[String]
|
|
29
|
-
def success_bucket_keys: (_ToI window_end) -> Array[String]
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Storage
|
|
4
|
-
class CompatibilityMetrics
|
|
5
|
-
include Domain::_MetricsStore
|
|
6
|
-
|
|
7
|
-
private attr_reader data_store: Domain::_DataStore
|
|
8
|
-
private attr_reader config: Domain::Config
|
|
9
|
-
|
|
10
|
-
def initialize: (
|
|
11
|
-
data_store: Domain::_DataStore,
|
|
12
|
-
config: Domain::Config,
|
|
13
|
-
) -> void
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Storage
|
|
4
|
-
class CompatibilityRecoveryLock
|
|
5
|
-
include Domain::_RecoveryLockStore
|
|
6
|
-
private attr_reader data_store: Domain::_DataStore
|
|
7
|
-
private attr_reader config: Domain::Config
|
|
8
|
-
|
|
9
|
-
def initialize: (data_store: Domain::_DataStore, config: Domain::Config) -> void
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Storage
|
|
4
|
-
class CompatibilityRecoveryMetrics
|
|
5
|
-
include Domain::_MetricsStore
|
|
6
|
-
|
|
7
|
-
private attr_reader data_store: Domain::_DataStore
|
|
8
|
-
private attr_reader config: Domain::Config
|
|
9
|
-
|
|
10
|
-
def initialize: (data_store: Domain::_DataStore, config: Domain::Config) -> void
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Infrastructure
|
|
3
|
-
module Storage
|
|
4
|
-
class CompatibilityState
|
|
5
|
-
include Domain::_StateStore
|
|
6
|
-
|
|
7
|
-
private attr_reader data_store: Domain::_DataStore
|
|
8
|
-
private attr_reader config: Domain::Config
|
|
9
|
-
|
|
10
|
-
def initialize: (data_store: Domain::_DataStore, config: Domain::Config) -> void
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module Stoplight
|
|
2
|
-
module Wiring
|
|
3
|
-
class System
|
|
4
|
-
class LightBuilder < Wiring::LightBuilder
|
|
5
|
-
attr_reader system: System
|
|
6
|
-
|
|
7
|
-
@failover_system: _System
|
|
8
|
-
@storage_set: StorageSet
|
|
9
|
-
@key_space: Infrastructure::Redis::Storage::KeySpace
|
|
10
|
-
|
|
11
|
-
def initialize: (config: Domain::Config, factory: Domain::_LightFactory, system: System) -> void
|
|
12
|
-
|
|
13
|
-
def key_space: -> Infrastructure::Redis::Storage::KeySpace
|
|
14
|
-
|
|
15
|
-
private def redis: -> redis
|
|
16
|
-
private def storage_scripting: -> Infrastructure::Redis::Storage::Scripting
|
|
17
|
-
private def failover_system: -> _System
|
|
18
|
-
private def storage_set: -> StorageSet
|
|
19
|
-
private def build_backend: -> DataStoreBackend
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Stoplight
|
|
4
|
-
module Wiring
|
|
5
|
-
class System
|
|
6
|
-
class LightFactory < Wiring::LightFactory
|
|
7
|
-
class InternalLightFactory
|
|
8
|
-
include Domain::_LightFactory
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
attr_reader system: System
|
|
12
|
-
|
|
13
|
-
def initialize: (system: System, config: Domain::Config) -> void
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|