diff --git a/experiments/experiments/experiment_one_of_many_services_degradation.rb b/experiments/experiments/experiment_one_of_many_services_degradation.rb index fc7028ca5..fe7823398 100644 --- a/experiments/experiments/experiment_one_of_many_services_degradation.rb +++ b/experiments/experiments/experiment_one_of_many_services_degradation.rb @@ -9,7 +9,7 @@ runner = Semian::Experiments::CircuitBreakerExperimentRunner.new( experiment_name: "One of Many Services Degradation Experiment", - resource_name: "protected_service", + resource_name: "protected_service_one_of_many_services_degradation", degradation_phases: [Semian::Experiments::DegradationPhase.new(healthy: true)] * 1 + [Semian::Experiments::DegradationPhase.new(latency: 4.95)] * 10 + # Most requests to the target service will timeout [Semian::Experiments::DegradationPhase.new(healthy: true)] * 3, diff --git a/experiments/experiments/experiment_one_of_many_services_degradation_adaptive.rb b/experiments/experiments/experiment_one_of_many_services_degradation_adaptive.rb index 793f7f33d..c49f0654a 100644 --- a/experiments/experiments/experiment_one_of_many_services_degradation_adaptive.rb +++ b/experiments/experiments/experiment_one_of_many_services_degradation_adaptive.rb @@ -9,7 +9,7 @@ runner = Semian::Experiments::CircuitBreakerExperimentRunner.new( experiment_name: "One of Many Services Degradation Experiment", - resource_name: "protected_service_adaptive", + resource_name: "protected_service_one_of_many_services_degradation_adaptive", degradation_phases: [Semian::Experiments::DegradationPhase.new(healthy: true)] * 1 + [Semian::Experiments::DegradationPhase.new(latency: 4.95)] * 10 + # Most requests to the target service will timeout [Semian::Experiments::DegradationPhase.new(healthy: true)] * 3, diff --git a/experiments/experiments/experiment_slow_query.rb b/experiments/experiments/experiment_slow_query.rb index 76cdeb1ad..d253ba0ba 100644 --- a/experiments/experiments/experiment_slow_query.rb +++ b/experiments/experiments/experiment_slow_query.rb @@ -9,7 +9,7 @@ runner = Semian::Experiments::CircuitBreakerExperimentRunner.new( experiment_name: "Slow Query Experiment", - resource_name: "protected_service", + resource_name: "protected_service_slow_query", degradation_phases: [Semian::Experiments::DegradationPhase.new(healthy: true)] * 1 + [Semian::Experiments::DegradationPhase.new(specific_endpoint_latency: 9.5)] * 10 + # This should lead the service to get overwhelmed and start rejecting requests [Semian::Experiments::DegradationPhase.new(healthy: true)] * 3, diff --git a/experiments/experiments/experiment_slow_query_adaptive.rb b/experiments/experiments/experiment_slow_query_adaptive.rb index 1adf9c2c4..32e7df835 100644 --- a/experiments/experiments/experiment_slow_query_adaptive.rb +++ b/experiments/experiments/experiment_slow_query_adaptive.rb @@ -9,7 +9,7 @@ runner = Semian::Experiments::CircuitBreakerExperimentRunner.new( experiment_name: "Slow Query Experiment (Adaptive)", - resource_name: "protected_service", + resource_name: "protected_service_slow_query_adaptive", degradation_phases: [Semian::Experiments::DegradationPhase.new(healthy: true)] * 1 + [Semian::Experiments::DegradationPhase.new(specific_endpoint_latency: 9.5)] * 10 + # This should lead the service to get overwhelmed and start rejecting requests [Semian::Experiments::DegradationPhase.new(healthy: true)] * 3, diff --git a/experiments/results/duration_graphs/duration-gradual_increase.png b/experiments/results/duration_graphs/duration-gradual_increase.png index fbb99639d..fe112d174 100644 Binary files a/experiments/results/duration_graphs/duration-gradual_increase.png and b/experiments/results/duration_graphs/duration-gradual_increase.png differ diff --git a/experiments/results/duration_graphs/duration-gradual_increase_adaptive.png b/experiments/results/duration_graphs/duration-gradual_increase_adaptive.png index 83892cc05..6819010dc 100644 Binary files a/experiments/results/duration_graphs/duration-gradual_increase_adaptive.png and b/experiments/results/duration_graphs/duration-gradual_increase_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation.png b/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation.png index f80abff89..5d393d810 100644 Binary files a/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation.png and b/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation.png differ diff --git a/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation_adaptive.png b/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation_adaptive.png index 02ce8ac63..af5c32a15 100644 Binary files a/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation_adaptive.png and b/experiments/results/duration_graphs/duration-one_of_many_services_latency_degradation_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-oscillating_errors.png b/experiments/results/duration_graphs/duration-oscillating_errors.png index d72c6d2c3..60f7b0c8c 100644 Binary files a/experiments/results/duration_graphs/duration-oscillating_errors.png and b/experiments/results/duration_graphs/duration-oscillating_errors.png differ diff --git a/experiments/results/duration_graphs/duration-oscillating_errors_adaptive.png b/experiments/results/duration_graphs/duration-oscillating_errors_adaptive.png index 9e681fd40..ca1933c88 100644 Binary files a/experiments/results/duration_graphs/duration-oscillating_errors_adaptive.png and b/experiments/results/duration_graphs/duration-oscillating_errors_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-slow_query.png b/experiments/results/duration_graphs/duration-slow_query.png index dbb1b0f82..b2ce84434 100644 Binary files a/experiments/results/duration_graphs/duration-slow_query.png and b/experiments/results/duration_graphs/duration-slow_query.png differ diff --git a/experiments/results/duration_graphs/duration-slow_query_adaptive.png b/experiments/results/duration_graphs/duration-slow_query_adaptive.png index 4dcc41fa2..f3f9a3222 100644 Binary files a/experiments/results/duration_graphs/duration-slow_query_adaptive.png and b/experiments/results/duration_graphs/duration-slow_query_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spike_100.png b/experiments/results/duration_graphs/duration-sudden_error_spike_100.png index 2583c4e39..9cce207ea 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spike_100.png and b/experiments/results/duration_graphs/duration-sudden_error_spike_100.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spike_100_adaptive.png b/experiments/results/duration_graphs/duration-sudden_error_spike_100_adaptive.png index 3a1f06a61..4624daede 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spike_100_adaptive.png and b/experiments/results/duration_graphs/duration-sudden_error_spike_100_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spike_20.png b/experiments/results/duration_graphs/duration-sudden_error_spike_20.png index d9a267abb..1c6f6cf42 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spike_20.png and b/experiments/results/duration_graphs/duration-sudden_error_spike_20.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spike_20_adaptive.png b/experiments/results/duration_graphs/duration-sudden_error_spike_20_adaptive.png index 0086772c5..f4588ed1a 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spike_20_adaptive.png and b/experiments/results/duration_graphs/duration-sudden_error_spike_20_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spikes.png b/experiments/results/duration_graphs/duration-sudden_error_spikes.png index e98111a51..5e73fc656 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spikes.png and b/experiments/results/duration_graphs/duration-sudden_error_spikes.png differ diff --git a/experiments/results/duration_graphs/duration-sudden_error_spikes_adaptive.png b/experiments/results/duration_graphs/duration-sudden_error_spikes_adaptive.png index fdb527dbf..245e797c1 100644 Binary files a/experiments/results/duration_graphs/duration-sudden_error_spikes_adaptive.png and b/experiments/results/duration_graphs/duration-sudden_error_spikes_adaptive.png differ diff --git a/experiments/results/duration_graphs/duration-sustained_load.png b/experiments/results/duration_graphs/duration-sustained_load.png index f9da94059..5b7ef7e5a 100644 Binary files a/experiments/results/duration_graphs/duration-sustained_load.png and b/experiments/results/duration_graphs/duration-sustained_load.png differ diff --git a/experiments/results/duration_graphs/duration-sustained_load_adaptive.png b/experiments/results/duration_graphs/duration-sustained_load_adaptive.png index d34e13631..c6f5eb73a 100644 Binary files a/experiments/results/duration_graphs/duration-sustained_load_adaptive.png and b/experiments/results/duration_graphs/duration-sustained_load_adaptive.png differ diff --git a/experiments/results/main_graphs/gradual_increase.png b/experiments/results/main_graphs/gradual_increase.png index 8e784f6f4..840967614 100644 Binary files a/experiments/results/main_graphs/gradual_increase.png and b/experiments/results/main_graphs/gradual_increase.png differ diff --git a/experiments/results/main_graphs/gradual_increase_adaptive.png b/experiments/results/main_graphs/gradual_increase_adaptive.png index addd01f1c..f1ecbcc87 100644 Binary files a/experiments/results/main_graphs/gradual_increase_adaptive.png and b/experiments/results/main_graphs/gradual_increase_adaptive.png differ diff --git a/experiments/results/main_graphs/one_of_many_services_latency_degradation.png b/experiments/results/main_graphs/one_of_many_services_latency_degradation.png index 27476165e..1c7402ea4 100644 Binary files a/experiments/results/main_graphs/one_of_many_services_latency_degradation.png and b/experiments/results/main_graphs/one_of_many_services_latency_degradation.png differ diff --git a/experiments/results/main_graphs/one_of_many_services_latency_degradation_adaptive.png b/experiments/results/main_graphs/one_of_many_services_latency_degradation_adaptive.png index 083a3a4df..4b033bda4 100644 Binary files a/experiments/results/main_graphs/one_of_many_services_latency_degradation_adaptive.png and b/experiments/results/main_graphs/one_of_many_services_latency_degradation_adaptive.png differ diff --git a/experiments/results/main_graphs/oscillating_errors.png b/experiments/results/main_graphs/oscillating_errors.png index 3dd98b4f6..a529334cc 100644 Binary files a/experiments/results/main_graphs/oscillating_errors.png and b/experiments/results/main_graphs/oscillating_errors.png differ diff --git a/experiments/results/main_graphs/oscillating_errors_adaptive.png b/experiments/results/main_graphs/oscillating_errors_adaptive.png index 3dcaf84ea..e6ac388df 100644 Binary files a/experiments/results/main_graphs/oscillating_errors_adaptive.png and b/experiments/results/main_graphs/oscillating_errors_adaptive.png differ diff --git a/experiments/results/main_graphs/slow_query.png b/experiments/results/main_graphs/slow_query.png index 4dd6a8e90..f97d802b2 100644 Binary files a/experiments/results/main_graphs/slow_query.png and b/experiments/results/main_graphs/slow_query.png differ diff --git a/experiments/results/main_graphs/slow_query_adaptive.png b/experiments/results/main_graphs/slow_query_adaptive.png index 2f8ac1ecd..5dd393532 100644 Binary files a/experiments/results/main_graphs/slow_query_adaptive.png and b/experiments/results/main_graphs/slow_query_adaptive.png differ diff --git a/experiments/results/main_graphs/sudden_error_spike_100.png b/experiments/results/main_graphs/sudden_error_spike_100.png index 3260f7460..070c469b9 100644 Binary files a/experiments/results/main_graphs/sudden_error_spike_100.png and b/experiments/results/main_graphs/sudden_error_spike_100.png differ diff --git a/experiments/results/main_graphs/sudden_error_spike_100_adaptive.png b/experiments/results/main_graphs/sudden_error_spike_100_adaptive.png index b9164d5ca..d12113c56 100644 Binary files a/experiments/results/main_graphs/sudden_error_spike_100_adaptive.png and b/experiments/results/main_graphs/sudden_error_spike_100_adaptive.png differ diff --git a/experiments/results/main_graphs/sudden_error_spike_20.png b/experiments/results/main_graphs/sudden_error_spike_20.png index c9bb6b597..71c93fa11 100644 Binary files a/experiments/results/main_graphs/sudden_error_spike_20.png and b/experiments/results/main_graphs/sudden_error_spike_20.png differ diff --git a/experiments/results/main_graphs/sudden_error_spike_20_adaptive.png b/experiments/results/main_graphs/sudden_error_spike_20_adaptive.png index 412972d94..ee5d80f75 100644 Binary files a/experiments/results/main_graphs/sudden_error_spike_20_adaptive.png and b/experiments/results/main_graphs/sudden_error_spike_20_adaptive.png differ diff --git a/experiments/results/main_graphs/sudden_error_spikes.png b/experiments/results/main_graphs/sudden_error_spikes.png index fd12ade92..326485203 100644 Binary files a/experiments/results/main_graphs/sudden_error_spikes.png and b/experiments/results/main_graphs/sudden_error_spikes.png differ diff --git a/experiments/results/main_graphs/sudden_error_spikes_adaptive.png b/experiments/results/main_graphs/sudden_error_spikes_adaptive.png index 8c2b8ce79..585fd8301 100644 Binary files a/experiments/results/main_graphs/sudden_error_spikes_adaptive.png and b/experiments/results/main_graphs/sudden_error_spikes_adaptive.png differ diff --git a/experiments/results/main_graphs/sustained_load.png b/experiments/results/main_graphs/sustained_load.png index 5ff9054a2..a8a727798 100644 Binary files a/experiments/results/main_graphs/sustained_load.png and b/experiments/results/main_graphs/sustained_load.png differ diff --git a/experiments/results/main_graphs/sustained_load_adaptive.png b/experiments/results/main_graphs/sustained_load_adaptive.png index a927836e2..3781561e8 100644 Binary files a/experiments/results/main_graphs/sustained_load_adaptive.png and b/experiments/results/main_graphs/sustained_load_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-gradual_increase.png b/experiments/results/throughput_graphs/throughput-gradual_increase.png index 44d564906..53401706e 100644 Binary files a/experiments/results/throughput_graphs/throughput-gradual_increase.png and b/experiments/results/throughput_graphs/throughput-gradual_increase.png differ diff --git a/experiments/results/throughput_graphs/throughput-gradual_increase_adaptive.png b/experiments/results/throughput_graphs/throughput-gradual_increase_adaptive.png index de139993b..5edcf029e 100644 Binary files a/experiments/results/throughput_graphs/throughput-gradual_increase_adaptive.png and b/experiments/results/throughput_graphs/throughput-gradual_increase_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation.png b/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation.png index ccf440b94..70e934136 100644 Binary files a/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation.png and b/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation.png differ diff --git a/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation_adaptive.png b/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation_adaptive.png index 380acc8f4..4f9c8969f 100644 Binary files a/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation_adaptive.png and b/experiments/results/throughput_graphs/throughput-one_of_many_services_latency_degradation_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-oscillating_errors.png b/experiments/results/throughput_graphs/throughput-oscillating_errors.png index 5fa434fdc..aa126fd7f 100644 Binary files a/experiments/results/throughput_graphs/throughput-oscillating_errors.png and b/experiments/results/throughput_graphs/throughput-oscillating_errors.png differ diff --git a/experiments/results/throughput_graphs/throughput-oscillating_errors_adaptive.png b/experiments/results/throughput_graphs/throughput-oscillating_errors_adaptive.png index fcebdd288..790cfab9d 100644 Binary files a/experiments/results/throughput_graphs/throughput-oscillating_errors_adaptive.png and b/experiments/results/throughput_graphs/throughput-oscillating_errors_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-slow_query.png b/experiments/results/throughput_graphs/throughput-slow_query.png index 2a2f76c19..064f9961f 100644 Binary files a/experiments/results/throughput_graphs/throughput-slow_query.png and b/experiments/results/throughput_graphs/throughput-slow_query.png differ diff --git a/experiments/results/throughput_graphs/throughput-slow_query_adaptive.png b/experiments/results/throughput_graphs/throughput-slow_query_adaptive.png index 3e0c99e0d..85e7957dc 100644 Binary files a/experiments/results/throughput_graphs/throughput-slow_query_adaptive.png and b/experiments/results/throughput_graphs/throughput-slow_query_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spike_100.png b/experiments/results/throughput_graphs/throughput-sudden_error_spike_100.png index 1827cfaba..10b6ed02f 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spike_100.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spike_100.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spike_100_adaptive.png b/experiments/results/throughput_graphs/throughput-sudden_error_spike_100_adaptive.png index a6756cfa8..4e70d3ac8 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spike_100_adaptive.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spike_100_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spike_20.png b/experiments/results/throughput_graphs/throughput-sudden_error_spike_20.png index 4a5391580..5d6063d4d 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spike_20.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spike_20.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spike_20_adaptive.png b/experiments/results/throughput_graphs/throughput-sudden_error_spike_20_adaptive.png index 056c0a852..d6569681b 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spike_20_adaptive.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spike_20_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spikes.png b/experiments/results/throughput_graphs/throughput-sudden_error_spikes.png index b7a8450cb..f0e732fc0 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spikes.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spikes.png differ diff --git a/experiments/results/throughput_graphs/throughput-sudden_error_spikes_adaptive.png b/experiments/results/throughput_graphs/throughput-sudden_error_spikes_adaptive.png index 149fa1da4..bbd80b925 100644 Binary files a/experiments/results/throughput_graphs/throughput-sudden_error_spikes_adaptive.png and b/experiments/results/throughput_graphs/throughput-sudden_error_spikes_adaptive.png differ diff --git a/experiments/results/throughput_graphs/throughput-sustained_load.png b/experiments/results/throughput_graphs/throughput-sustained_load.png index 338784e39..5dc2a61e2 100644 Binary files a/experiments/results/throughput_graphs/throughput-sustained_load.png and b/experiments/results/throughput_graphs/throughput-sustained_load.png differ diff --git a/experiments/results/throughput_graphs/throughput-sustained_load_adaptive.png b/experiments/results/throughput_graphs/throughput-sustained_load_adaptive.png index f8fe15dec..3e9a6709b 100644 Binary files a/experiments/results/throughput_graphs/throughput-sustained_load_adaptive.png and b/experiments/results/throughput_graphs/throughput-sustained_load_adaptive.png differ diff --git a/lib/semian.rb b/lib/semian.rb index 784876d7e..05a49ba86 100644 --- a/lib/semian.rb +++ b/lib/semian.rb @@ -317,7 +317,7 @@ def create_adaptive_circuit_breaker(name, **options) AdaptiveCircuitBreaker.new( name: name, kp: 0.75, # Standard proportional gain - ki: 0.01, # Moderate integral gain + ki: 0.1, # Moderate integral gain kd: 0.5, # Small derivative gain (as per design doc) window_size: 10, # 10-second window for rate calculation and update interval initial_history_duration: 900, # 15 minutes of initial history for p90 calculation