Skip to content

Commit da61ef0

Browse files
committed
remove redundant mixed-workload flag
1 parent 01dfafe commit da61ef0

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

engine/base_client/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ def run_experiment(
180180

181181
# Extract mixed workload parameters
182182
insert_fraction = 0.0
183+
seed = None
183184
if mixed_workload_params:
184-
insert_fraction = mixed_workload_params.get("insert_fraction", 0.1)
185+
insert_fraction = mixed_workload_params.get("insert_fraction", 0.0)
185186
seed = mixed_workload_params.get("seed", None)
186187
if seed is not None:
187188
random.seed(seed) # Set seed for reproducible patterns

engine/base_client/search.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,18 @@ def cycling_query_generator(queries, total_count):
297297
if need_interval_reporting:
298298
interval_search_precisions = [result[1] for result in interval_results if result[0] == 'search']
299299

300+
# Calculate separate RPS for searches and inserts
301+
search_rps = interval_search_count / interval_time if interval_search_count > 0 else 0
302+
insert_rps = interval_insert_count / interval_time if interval_insert_count > 0 else 0
303+
300304
# Create interval statistics for output file
301305
interval_stat = {
302306
"interval": interval_counter,
303307
"operations": current_interval_size,
304308
"time_seconds": float(interval_time), # Ensure it's a float
305-
"rps": float(current_interval_size / interval_time), # Ensure it's a float
309+
"total_rps": float(current_interval_size / interval_time), # Overall RPS
310+
"search_rps": float(search_rps), # Search-only RPS
311+
"insert_rps": float(insert_rps), # Insert-only RPS
306312
"searches": interval_search_count,
307313
"inserts": interval_insert_count,
308314
"search_precision": float(np.mean(interval_search_precisions)) if interval_search_precisions else None
@@ -312,11 +318,13 @@ def cycling_query_generator(queries, total_count):
312318
# Debug: Print number of intervals collected so far
313319
print(f"DEBUG: Collected {len(interval_stats)} intervals so far", flush=True)
314320

315-
# Update progress bar with same metrics (this goes to terminal)
321+
# Update progress bar with separate RPS metrics
316322
if interval_pbar:
317323
interval_pbar.update(1)
318324
interval_pbar.set_postfix({
319-
'RPS': f"{current_interval_size / interval_time:.1f}",
325+
'Total_RPS': f"{current_interval_size / interval_time:.1f}",
326+
'Search_RPS': f"{search_rps:.1f}",
327+
'Insert_RPS': f"{insert_rps:.1f}",
320328
'Searches': interval_search_count,
321329
'Inserts': interval_insert_count,
322330
'Precision': f"{np.mean(interval_search_precisions):.4f}" if interval_search_precisions else "N/A"

run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ def run(
3030
ef_runtime: List[int] = typer.Option([], help="Filter search experiments by ef runtime values. Only experiments with these ef values will be run."),
3131
describe: str = typer.Option(None, help="Describe available options: 'datasets' or 'engines'. When used, shows information and exits."),
3232
verbose: bool = typer.Option(False, "--verbose", "-v", help="Show detailed information when using --describe"),
33-
mixed_workload: bool = typer.Option(False, help="Enable mixed workload mode"),
34-
insert_fraction: float = typer.Option(0.1, help="Fraction of operations that are inserts (0.0-1.0)"),
33+
insert_fraction: float = typer.Option(0.0, help="Fraction of operations that are inserts (0.0-1.0). Mixed workload is automatically enabled when > 0.0"),
3534
mixed_workload_seed: int = typer.Option(None, help="Random seed for reproducible mixed workload patterns"),
3635
):
3736
"""
3837
Example:
3938
python3 run.py --engines *-m-16-* --engines qdrant-* --datasets glove-*
40-
python3 run.py --engines redis --datasets glove-* --mixed-workload --insert-fraction 0.2
39+
python3 run.py --engines redis --datasets glove-* --insert-fraction 0.2
4140
python3 run.py --describe datasets
4241
python3 run.py --describe engines --verbose
4342
"""
@@ -69,7 +68,8 @@ def run(
6968
}
7069

7170
mixed_params = {}
72-
if mixed_workload:
71+
# Automatically enable mixed workload when insert_fraction > 0
72+
if insert_fraction > 0:
7373
mixed_params = {
7474
"insert_fraction": insert_fraction,
7575
"seed": mixed_workload_seed

0 commit comments

Comments
 (0)