mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
Fix the way we compute the 99th percentile
This commit is contained in:
parent
377fe33aac
commit
d727ebee05
@ -761,12 +761,12 @@ impl SearchAggregator {
|
|||||||
if self.total_received == 0 {
|
if self.total_received == 0 {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
// the index of the 99th percentage of value
|
|
||||||
let percentile_99th = 0.99 * (self.total_succeeded as f64 - 1.) + 1.;
|
|
||||||
// we get all the values in a sorted manner
|
// we get all the values in a sorted manner
|
||||||
let time_spent = self.time_spent.into_sorted_vec();
|
let time_spent = self.time_spent.into_sorted_vec();
|
||||||
|
// the index of the 99th percentage of value
|
||||||
|
let percentile_99th = time_spent.len() * 99 / 100;
|
||||||
// We are only interested by the slowest value of the 99th fastest results
|
// We are only interested by the slowest value of the 99th fastest results
|
||||||
let time_spent = time_spent.get(percentile_99th as usize);
|
let time_spent = time_spent.get(percentile_99th);
|
||||||
|
|
||||||
let properties = json!({
|
let properties = json!({
|
||||||
"user-agent": self.user_agents,
|
"user-agent": self.user_agents,
|
||||||
|
Loading…
Reference in New Issue
Block a user