diff --git a/bigvectorbench/plotting/metrics.py b/bigvectorbench/plotting/metrics.py index bda22c6..d047900 100644 --- a/bigvectorbench/plotting/metrics.py +++ b/bigvectorbench/plotting/metrics.py @@ -68,6 +68,16 @@ def percentile_50(times): return np.percentile(times, 50.0) * 1000.0 +def percentile_90(times): + """ + 95th percentile + + :param times: list of query times + :return: 95th percentile in milliseconds + """ + return np.percentile(times, 90.0) * 1000.0 + + def percentile_95(times): """ 95th percentile @@ -157,6 +167,14 @@ def candidates(attrs): ), "worst": float("-inf"), }, + "avg_time": { + "description": "Average time (millis)", + "function": lambda true_neighbors, run_neighbors, metrics, times, run_attrs: np.mean( + times + ) + * 1000.0, + "worst": float("inf"), + }, "p50": { "description": "Percentile 50 (millis)", "function": lambda true_neighbors, run_neighbors, metrics, times, run_attrs: percentile_50( @@ -164,6 +182,13 @@ def candidates(attrs): ), "worst": float("inf"), }, + "p90": { + "description": "Percentile 50 (millis)", + "function": lambda true_neighbors, run_neighbors, metrics, times, run_attrs: percentile_90( + times + ), + "worst": float("inf"), + }, "p95": { "description": "Percentile 95 (millis)", "function": lambda true_neighbors, run_neighbors, metrics, times, run_attrs: percentile_95(