Skip to content

Commit

Permalink
fix: performance decay impact on success rate
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Feb 23, 2024
1 parent 9dfda7d commit 2768b37
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion candidate-selection/src/criteria/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ impl Performance {
}

fn success_rate(&self) -> Normalized {
let successful_responses: f64 = self.latency_success.map(|f| f.response_count).sum();
let mut successful_responses: f64 = self.latency_success.map(|f| f.response_count).sum();
// This results in decay pulling success rate upward.
successful_responses += 1.0;
let failed_responses: f64 = self.latency_failure.map(|f| f.response_count).sum();
Normalized::new(successful_responses / (successful_responses + failed_responses).max(1.0))
.unwrap()
Expand Down

0 comments on commit 2768b37

Please sign in to comment.