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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Minimal stand-in for `Rails::Generators::Base` so InstallGenerator's signature resolves for
|
|
2
|
+
# consumers that depend on this gem's sig/ without depending on Rails themselves (e.g. via a
|
|
3
|
+
# git Gemfile source, which loads the whole sig/ tree). Real Rails apps get the full definition
|
|
4
|
+
# from rbs-rails; RBS merges declarations of the same class across files, so this is harmless
|
|
5
|
+
# there too.
|
|
6
|
+
module Rails
|
|
7
|
+
module Generators
|
|
8
|
+
class Base
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
class ConfigSerializer
|
|
4
|
+
def self.call: (Domain::Config)-> Hash[String, untyped]
|
|
5
|
+
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def self.serialize_traffic_control: (Domain::_TrafficControl) -> String
|
|
9
|
+
def self.serialize_traffic_recovery: (Domain::_TrafficRecovery) -> String
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module FailSafe
|
|
4
|
+
class ErrorNotifier
|
|
5
|
+
include Domain::_ErrorNotifier
|
|
6
|
+
|
|
7
|
+
attr_reader error_notifier: Domain::error_notifier
|
|
8
|
+
|
|
9
|
+
def initialize: (error_notifier: Domain::error_notifier) -> void
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -6,13 +6,13 @@ module Stoplight
|
|
|
6
6
|
include Domain::_MetricsStore
|
|
7
7
|
|
|
8
8
|
attr_reader primary_store: Domain::_MetricsStore
|
|
9
|
-
attr_reader error_notifier: error_notifier
|
|
9
|
+
attr_reader error_notifier: Domain::error_notifier
|
|
10
10
|
attr_reader failover_store: Domain::_MetricsStore
|
|
11
11
|
attr_reader circuit_breaker: Domain::Light
|
|
12
12
|
|
|
13
13
|
def initialize: (
|
|
14
14
|
primary_store: Domain::_MetricsStore,
|
|
15
|
-
error_notifier: error_notifier,
|
|
15
|
+
error_notifier: Domain::error_notifier,
|
|
16
16
|
failover_store: Domain::_MetricsStore,
|
|
17
17
|
circuit_breaker: Domain::Light
|
|
18
18
|
) -> void
|
data/sig/{_private/stoplight → stoplight}/infrastructure/fail_safe/storage/recovery_lock.rbs
RENAMED
|
@@ -4,13 +4,13 @@ module Stoplight
|
|
|
4
4
|
module Storage
|
|
5
5
|
class RecoveryLock
|
|
6
6
|
attr_reader primary_store: Domain::_RecoveryLockStore
|
|
7
|
-
attr_reader error_notifier: error_notifier
|
|
7
|
+
attr_reader error_notifier: Domain::error_notifier
|
|
8
8
|
attr_reader failover_store: Domain::_RecoveryLockStore
|
|
9
9
|
attr_reader circuit_breaker: Domain::Light
|
|
10
10
|
|
|
11
11
|
def initialize: (
|
|
12
12
|
primary_store: Domain::_RecoveryLockStore,
|
|
13
|
-
error_notifier: error_notifier,
|
|
13
|
+
error_notifier: Domain::error_notifier,
|
|
14
14
|
failover_store: Domain::_RecoveryLockStore,
|
|
15
15
|
circuit_breaker: Domain::Light
|
|
16
16
|
) -> void
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module FailSafe
|
|
4
|
+
module Storage
|
|
5
|
+
class Registry
|
|
6
|
+
include Domain::_Registry
|
|
7
|
+
|
|
8
|
+
@primary_registry: Domain::_Registry
|
|
9
|
+
@error_notifier: Domain::error_notifier
|
|
10
|
+
@failover_registry: Domain::_Registry
|
|
11
|
+
@circuit_breaker: Domain::Light
|
|
12
|
+
|
|
13
|
+
def initialize: (
|
|
14
|
+
primary_registry: Domain::_Registry,
|
|
15
|
+
error_notifier: Domain::error_notifier,
|
|
16
|
+
failover_registry: Domain::_Registry,
|
|
17
|
+
circuit_breaker: Domain::Light
|
|
18
|
+
) -> void
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -6,15 +6,15 @@ module Stoplight
|
|
|
6
6
|
include Domain::_StateStore
|
|
7
7
|
|
|
8
8
|
attr_reader primary_store: Domain::_StateStore
|
|
9
|
-
attr_reader error_notifier: error_notifier
|
|
9
|
+
attr_reader error_notifier: Domain::error_notifier
|
|
10
10
|
attr_reader failover_store: Domain::_StateStore
|
|
11
|
-
attr_reader circuit_breaker:
|
|
11
|
+
attr_reader circuit_breaker: Domain::Light
|
|
12
12
|
|
|
13
13
|
def initialize: (
|
|
14
14
|
primary_store: Domain::_StateStore,
|
|
15
|
-
error_notifier: error_notifier,
|
|
15
|
+
error_notifier: Domain::error_notifier,
|
|
16
16
|
failover_store: Domain::_StateStore,
|
|
17
|
-
circuit_breaker:
|
|
17
|
+
circuit_breaker: Domain::Light,
|
|
18
18
|
) -> void
|
|
19
19
|
|
|
20
20
|
def fallback: [T] { () -> T } -> ^(StandardError?) -> T
|
|
@@ -5,16 +5,16 @@ module Stoplight
|
|
|
5
5
|
class State
|
|
6
6
|
include Domain::_StateStore
|
|
7
7
|
|
|
8
|
-
attr_accessor locked_state: state
|
|
8
|
+
attr_accessor locked_state: Domain::state
|
|
9
9
|
attr_accessor recovered_at: Time?
|
|
10
10
|
attr_accessor recovery_scheduled_after: Time?
|
|
11
11
|
attr_accessor recovery_started_at: Time?
|
|
12
12
|
attr_accessor breached_at: Time?
|
|
13
13
|
attr_reader mutex: Mutex
|
|
14
14
|
attr_reader clock: Domain::_Clock
|
|
15
|
-
attr_reader cool_off_time:
|
|
15
|
+
attr_reader cool_off_time: Domain::duration_seconds
|
|
16
16
|
|
|
17
|
-
def initialize: (clock: Domain::_Clock, cool_off_time:
|
|
17
|
+
def initialize: (clock: Domain::_Clock, cool_off_time: Domain::duration_seconds) -> void
|
|
18
18
|
|
|
19
19
|
def transition_to_green: -> bool
|
|
20
20
|
|
data/sig/{_private/stoplight → stoplight}/infrastructure/memory/storage/unbounded_metrics.rbs
RENAMED
|
@@ -5,19 +5,19 @@ module Stoplight
|
|
|
5
5
|
class UnboundedMetrics
|
|
6
6
|
include Domain::_MetricsStore
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
attr_reader clock: Domain::_Clock
|
|
8
|
+
@consecutive_errors: Integer
|
|
9
|
+
@consecutive_successes: Integer
|
|
10
|
+
@last_error: Domain::Failure?
|
|
11
|
+
@last_success_at: Time?
|
|
12
|
+
@mutex: Mutex
|
|
13
|
+
@clock: Domain::_Clock
|
|
15
14
|
|
|
16
15
|
def initialize: (clock: Domain::_Clock) -> void
|
|
17
16
|
|
|
18
17
|
def last_error_at: -> Time?
|
|
19
18
|
|
|
20
19
|
private def initialize_metrics: -> void
|
|
20
|
+
private def build_metrics_snapshot: -> Domain::MetricsSnapshot
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module Memory
|
|
4
|
+
module Storage
|
|
5
|
+
class WindowMetrics
|
|
6
|
+
class SlidingWindow
|
|
7
|
+
@buckets: Hash[Integer, Integer]
|
|
8
|
+
@running_sum: Integer
|
|
9
|
+
@evicted_through: Integer?
|
|
10
|
+
@clock: Domain::_Clock
|
|
11
|
+
@window_size: Domain::duration_seconds
|
|
12
|
+
|
|
13
|
+
def initialize: (clock: Domain::_Clock, window_size: Domain::duration_seconds) -> void
|
|
14
|
+
|
|
15
|
+
def increment: -> void
|
|
16
|
+
|
|
17
|
+
def sum_in_window: -> Integer
|
|
18
|
+
|
|
19
|
+
private def slide_window!: (Float window_start) -> void
|
|
20
|
+
|
|
21
|
+
def inspect: -> String
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -5,20 +5,20 @@ module Stoplight
|
|
|
5
5
|
class WindowMetrics
|
|
6
6
|
include Domain::_MetricsStore
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@window_size: duration
|
|
8
|
+
@mutex: Mutex
|
|
9
|
+
@clock: Domain::_Clock
|
|
10
|
+
@window_size: Domain::duration_seconds
|
|
12
11
|
@consecutive_errors: Integer
|
|
13
12
|
@consecutive_successes: Integer
|
|
14
13
|
@last_error: Domain::Failure?
|
|
15
14
|
@last_success_at: Time?
|
|
16
|
-
@successes:
|
|
17
|
-
@errors:
|
|
15
|
+
@successes: SlidingWindow
|
|
16
|
+
@errors: SlidingWindow
|
|
18
17
|
|
|
19
|
-
def initialize: (window_size:
|
|
18
|
+
def initialize: (window_size: Domain::duration_seconds, clock: Domain::_Clock) -> void
|
|
20
19
|
|
|
21
20
|
def initialize_metrics: -> void
|
|
21
|
+
def build_metrics_snapshot: () -> Domain::MetricsSnapshot
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module Notifier
|
|
4
|
+
class FailSafe
|
|
5
|
+
include Domain::_StateTransitionNotifier
|
|
6
|
+
|
|
7
|
+
attr_reader notifier: Domain::_StateTransitionNotifier
|
|
8
|
+
attr_reader error_notifier: Domain::error_notifier
|
|
9
|
+
attr_reader circuit_breaker: Domain::Light
|
|
10
|
+
|
|
11
|
+
def initialize: (notifier: Domain::_StateTransitionNotifier, error_notifier: Domain::error_notifier, circuit_breaker: Domain::Light) -> void
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -9,7 +9,7 @@ module Stoplight
|
|
|
9
9
|
|
|
10
10
|
def initialize: (T object, ?notification_formatter? formatter) -> void
|
|
11
11
|
|
|
12
|
-
def notify: (Domain::
|
|
12
|
+
def notify: (Domain::LightInfo light, Domain::color, Domain::color, StandardError?) -> String
|
|
13
13
|
|
|
14
14
|
private def put: (String) -> void
|
|
15
15
|
end
|
|
@@ -8,13 +8,13 @@ module Stoplight
|
|
|
8
8
|
attr_reader config: Domain::Config
|
|
9
9
|
attr_reader redis: redis
|
|
10
10
|
attr_reader scripting: Scripting
|
|
11
|
-
attr_reader key_space:
|
|
11
|
+
attr_reader key_space: Key
|
|
12
12
|
|
|
13
13
|
def initialize: (
|
|
14
14
|
config: Domain::Config,
|
|
15
15
|
redis: redis,
|
|
16
16
|
scripting: Scripting,
|
|
17
|
-
key_space:
|
|
17
|
+
key_space: Key
|
|
18
18
|
) -> void
|
|
19
19
|
|
|
20
20
|
def lock_key: -> String
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module Redis
|
|
4
|
+
module Storage
|
|
5
|
+
class Registry
|
|
6
|
+
include Domain::_Registry
|
|
7
|
+
|
|
8
|
+
@redis: redis
|
|
9
|
+
@key_space: Key
|
|
10
|
+
@clock: Domain::_Clock
|
|
11
|
+
@config_serializer: singleton(ConfigSerializer)
|
|
12
|
+
|
|
13
|
+
def initialize: (
|
|
14
|
+
redis: redis,
|
|
15
|
+
key_space: Key,
|
|
16
|
+
clock: Domain::_Clock,
|
|
17
|
+
config_serializer: singleton(ConfigSerializer),
|
|
18
|
+
) -> void
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def key: () -> String
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module Redis
|
|
4
|
+
module Storage
|
|
5
|
+
class Scripting
|
|
6
|
+
SCRIPTS_ROOT: String
|
|
7
|
+
|
|
8
|
+
INCLUDE_DIRECTIVE: Regexp
|
|
9
|
+
|
|
10
|
+
def self.default_scripts_path: -> Array[String]
|
|
11
|
+
|
|
12
|
+
@scripts_path: Array[String]
|
|
13
|
+
@shas: Hash[String, String]
|
|
14
|
+
@redis: redis
|
|
15
|
+
|
|
16
|
+
def initialize: (
|
|
17
|
+
redis: redis,
|
|
18
|
+
?scripts_path: Array[String],
|
|
19
|
+
) -> void
|
|
20
|
+
|
|
21
|
+
def call: (
|
|
22
|
+
String script_name,
|
|
23
|
+
?keys: Array[_ToS],
|
|
24
|
+
?args: Array[_ToS]
|
|
25
|
+
) -> untyped
|
|
26
|
+
|
|
27
|
+
private def reload_script: (String script_name) -> void
|
|
28
|
+
|
|
29
|
+
private def resolve_source: (String script_name) -> String
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -7,17 +7,17 @@ module Stoplight
|
|
|
7
7
|
|
|
8
8
|
attr_reader redis: redis
|
|
9
9
|
attr_reader scripting: Scripting
|
|
10
|
-
attr_reader key_space:
|
|
10
|
+
attr_reader key_space: Key
|
|
11
11
|
attr_reader clock: Domain::_Clock
|
|
12
|
-
attr_reader cool_off_time: timestamp
|
|
12
|
+
attr_reader cool_off_time: Domain::timestamp
|
|
13
13
|
attr_reader state_key: String
|
|
14
14
|
|
|
15
15
|
def initialize: (
|
|
16
16
|
clock: Domain::_Clock,
|
|
17
17
|
redis: redis,
|
|
18
18
|
scripting: Scripting,
|
|
19
|
-
key_space:
|
|
20
|
-
cool_off_time: timestamp
|
|
19
|
+
key_space: Key,
|
|
20
|
+
cool_off_time: Domain::timestamp
|
|
21
21
|
) -> void
|
|
22
22
|
|
|
23
23
|
def transition_to_green: -> bool
|
data/sig/{_private/stoplight → stoplight}/infrastructure/redis/storage/unbounded_metrics.rbs
RENAMED
|
@@ -12,8 +12,15 @@ module Stoplight
|
|
|
12
12
|
redis: redis,
|
|
13
13
|
clock: Domain::_Clock,
|
|
14
14
|
scripting: Scripting,
|
|
15
|
-
key_space:
|
|
15
|
+
key_space: Key,
|
|
16
16
|
) -> void
|
|
17
|
+
|
|
18
|
+
private def build_metrics_snapshot: (
|
|
19
|
+
consecutive_errors: String,
|
|
20
|
+
consecutive_successes: String,
|
|
21
|
+
last_error_json: String?,
|
|
22
|
+
last_success_at: String?
|
|
23
|
+
) -> Domain::MetricsSnapshot
|
|
17
24
|
end
|
|
18
25
|
end
|
|
19
26
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Infrastructure
|
|
3
|
+
module Redis
|
|
4
|
+
module Storage
|
|
5
|
+
class WindowMetrics < Metrics
|
|
6
|
+
METRICS_FIELDS: Array[String]
|
|
7
|
+
|
|
8
|
+
@redis: redis
|
|
9
|
+
@scripting: Scripting
|
|
10
|
+
@clock: Domain::_Clock
|
|
11
|
+
@metrics_key: Key
|
|
12
|
+
@ts_index_key: Key
|
|
13
|
+
@window_size: Integer
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
redis: redis,
|
|
17
|
+
scripting: Scripting,
|
|
18
|
+
config: Domain::Config,
|
|
19
|
+
clock: Domain::_Clock,
|
|
20
|
+
key_space: Key
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def build_metrics_snapshot: (
|
|
24
|
+
successes: Integer,
|
|
25
|
+
errors: Integer,
|
|
26
|
+
consecutive_errors: String,
|
|
27
|
+
consecutive_successes: String,
|
|
28
|
+
last_error_json: String?,
|
|
29
|
+
last_success_at: String?,
|
|
30
|
+
) -> Domain::MetricsSnapshot
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/sig/stoplight/notifier.rbs
CHANGED
|
@@ -2,20 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
module Stoplight
|
|
4
4
|
# A System is a composition root that groups related circuit breakers
|
|
5
|
-
# with shared configuration.
|
|
5
|
+
# with shared infrastructure configuration and defaults.
|
|
6
6
|
interface _System
|
|
7
7
|
def name: -> String
|
|
8
|
+
# @api private
|
|
9
|
+
def config: -> Domain::Config
|
|
8
10
|
|
|
9
|
-
def
|
|
11
|
+
def register: (
|
|
10
12
|
String name,
|
|
11
|
-
?cool_off_time: optional[
|
|
12
|
-
?threshold: optional[percentage | Integer],
|
|
13
|
+
?cool_off_time: optional[Domain::duration_seconds],
|
|
14
|
+
?threshold: optional[Domain::percentage | Integer],
|
|
13
15
|
?recovery_threshold: optional[Integer],
|
|
14
|
-
?window_size: optional[
|
|
15
|
-
?skipped_errors: optional[Array[
|
|
16
|
-
?tracked_errors: optional[Array[
|
|
17
|
-
?traffic_control: optional[traffic_control],
|
|
18
|
-
?traffic_recovery: optional[traffic_recovery]
|
|
19
|
-
) ->
|
|
16
|
+
?window_size: optional[Domain::duration_seconds?],
|
|
17
|
+
?skipped_errors: optional[Array[Module] | Module],
|
|
18
|
+
?tracked_errors: optional[Array[Module] | Module],
|
|
19
|
+
?traffic_control: optional[Wiring::traffic_control],
|
|
20
|
+
?traffic_recovery: optional[Wiring::traffic_recovery]
|
|
21
|
+
) -> Domain::Light
|
|
22
|
+
|
|
23
|
+
def light: (String name) -> Domain::Light
|
|
24
|
+
|
|
25
|
+
def telemetry: -> Domain::_Telemetry
|
|
20
26
|
end
|
|
21
27
|
end
|
data/sig/stoplight/state.rbs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
# Public face of the telemetry bus. The bus and its events live in the domain layer
|
|
3
|
+
# (Domain::Telemetry); this namespace re-exports them so callers never reference the
|
|
4
|
+
# Domain:: boundary - mirroring Stoplight::Notifier and Stoplight::DataStore.
|
|
5
|
+
module Telemetry
|
|
6
|
+
class RunCompleted = Domain::Telemetry::RunCompleted
|
|
7
|
+
class TrafficBreached = Domain::Telemetry::TrafficBreached
|
|
8
|
+
class RecoveryStarted = Domain::Telemetry::RecoveryStarted
|
|
9
|
+
class RecoverySucceeded = Domain::Telemetry::RecoverySucceeded
|
|
10
|
+
class RecoveryFailed = Domain::Telemetry::RecoveryFailed
|
|
11
|
+
class LockChanged = Domain::Telemetry::LockChanged
|
|
12
|
+
class RecoveryProbeCompleted = Domain::Telemetry::RecoveryProbeCompleted
|
|
13
|
+
class LightRegistered = Domain::Telemetry::LightRegistered
|
|
14
|
+
|
|
15
|
+
module StateTransitioned = Domain::Telemetry::StateTransitioned
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Wiring
|
|
3
|
+
module Default
|
|
4
|
+
COOL_OFF_TIME: Domain::duration_seconds
|
|
5
|
+
|
|
6
|
+
DATA_STORE: Domain::_DataStore
|
|
7
|
+
|
|
8
|
+
ERROR_NOTIFIER: Domain::error_notifier
|
|
9
|
+
|
|
10
|
+
FORMATTER: Infrastructure::notification_formatter
|
|
11
|
+
|
|
12
|
+
NOTIFIERS: Array[Domain::_StateTransitionNotifier]
|
|
13
|
+
|
|
14
|
+
THRESHOLD: Domain::percentage | Integer
|
|
15
|
+
RECOVERY_THRESHOLD: Integer
|
|
16
|
+
|
|
17
|
+
WINDOW_SIZE: Domain::duration_seconds?
|
|
18
|
+
|
|
19
|
+
TRACKED_ERRORS: Array[Module]
|
|
20
|
+
SKIPPED_ERRORS: Array[Module]
|
|
21
|
+
|
|
22
|
+
TRAFFIC_CONTROL: Domain::_TrafficControl
|
|
23
|
+
TRAFFIC_RECOVERY: Domain::_TrafficRecovery
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Stoplight
|
|
2
|
+
module Wiring
|
|
3
|
+
class DefaultConfiguration
|
|
4
|
+
@config: Domain::Config
|
|
5
|
+
@cool_off_time: optional[Domain::duration_seconds]
|
|
6
|
+
@threshold: optional[Domain::percentage | Integer]
|
|
7
|
+
@recovery_threshold: optional[Integer]
|
|
8
|
+
@window_size: optional[Domain::duration_seconds?]
|
|
9
|
+
@tracked_errors: optional[Array[Module] | Module]
|
|
10
|
+
@skipped_errors: optional[Array[Module] | Module]
|
|
11
|
+
@traffic_control: optional[traffic_control]
|
|
12
|
+
@traffic_recovery: optional[traffic_recovery]
|
|
13
|
+
@error_notifier: optional[Domain::error_notifier]
|
|
14
|
+
@data_store: optional[Domain::_DataStore]
|
|
15
|
+
@notifiers: optional[Array[Domain::_StateTransitionNotifier]]
|
|
16
|
+
|
|
17
|
+
def to_config!: -> Domain::Config
|
|
18
|
+
def notifiers: -> Array[Domain::_StateTransitionNotifier]
|
|
19
|
+
def cool_off_time=: (Domain::duration_seconds) -> void
|
|
20
|
+
def threshold=: (Domain::percentage | Integer) -> void
|
|
21
|
+
def recovery_threshold=: (Integer) -> void
|
|
22
|
+
def window_size=: (Domain::duration_seconds?) -> void
|
|
23
|
+
def tracked_errors=: (Array[Module] | Module) -> void
|
|
24
|
+
def skipped_errors=: (Array[Module] | Module) -> void
|
|
25
|
+
def traffic_control=: (Wiring::traffic_control) -> void
|
|
26
|
+
def traffic_recovery=: (Wiring::traffic_recovery) -> void
|
|
27
|
+
def error_notifier=: (Domain::error_notifier) -> void
|
|
28
|
+
def data_store=: (Domain::_DataStore) -> void
|
|
29
|
+
def notifiers=:(Array[Domain::_StateTransitionNotifier]) -> void
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def tracked_errors: -> optional[Array[Module]]
|
|
34
|
+
def skipped_errors: -> optional[Array[Module]]
|
|
35
|
+
def traffic_control: -> optional[Domain::_TrafficControl]
|
|
36
|
+
def traffic_recovery: -> optional[Domain::_TrafficRecovery]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|