From 421bec0b81df4e74185b29482dcd069de744fcdc Mon Sep 17 00:00:00 2001 From: rUv Date: Wed, 6 Aug 2025 11:52:19 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/benchmark/src/swarm=5Fbenchmark/cli/main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/checkpoints/task-1754481099.json | 1 + benchmark/src/swarm_benchmark/cli/main.py | 64 +++++++++++++++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .claude/checkpoints/task-1754481099.json diff --git a/.claude/checkpoints/task-1754481099.json b/.claude/checkpoints/task-1754481099.json new file mode 100644 index 0000000000..815db0b6a0 --- /dev/null +++ b/.claude/checkpoints/task-1754481099.json @@ -0,0 +1 @@ +{"checkpoint": "task-20250806-115138", "task": "can i improve the report to include the refernce to the file and details? @ruvnet āžœ /workspaces/cl", "timestamp": "2025-08-06T11:51:39Z", "commit": "c652668c0d4041b6ef3d488f5b3139f05376b8e1", "github_release": "true"} diff --git a/benchmark/src/swarm_benchmark/cli/main.py b/benchmark/src/swarm_benchmark/cli/main.py index 211cbae4d1..296c21bfab 100644 --- a/benchmark/src/swarm_benchmark/cli/main.py +++ b/benchmark/src/swarm_benchmark/cli/main.py @@ -305,10 +305,68 @@ def swarm(ctx, objective, strategy, mode, sparc_mode, all_modes, max_agents, tim result = asyncio.run(_run_real_benchmark(objective, config, sparc_mode, all_modes)) if result: - click.echo(f"āœ… Real benchmark completed successfully!") - click.echo(f"šŸ“Š Results saved to: {output_dir}") + # Generate detailed report + click.echo(f"\n{'='*60}") + click.echo(f"āœ… Real Benchmark Completed Successfully!") + click.echo(f"{'='*60}") + + # Basic info + click.echo(f"šŸ“‹ Objective: {objective}") + click.echo(f"šŸŽÆ Strategy: {strategy.upper()}") + click.echo(f"šŸ”„ Mode: {mode.upper()}") + + # Metrics if available + if 'metrics' in result: + metrics = result['metrics'] + click.echo(f"\nšŸ“Š Performance Metrics:") + if 'wall_clock_time' in metrics: + click.echo(f" ā±ļø Execution Time: {metrics['wall_clock_time']:.2f}s") + if 'tasks_per_second' in metrics: + click.echo(f" ⚔ Tasks/Second: {metrics['tasks_per_second']:.2f}") + if 'success_rate' in metrics: + click.echo(f" āœ“ Success Rate: {metrics['success_rate']:.1%}") + if 'peak_memory_mb' in metrics: + click.echo(f" šŸ’¾ Peak Memory: {metrics['peak_memory_mb']:.1f} MB") + if 'average_cpu_percent' in metrics: + click.echo(f" šŸ–„ļø Avg CPU: {metrics['average_cpu_percent']:.1f}%") + + # File outputs + import os + from pathlib import Path + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + benchmark_id = result.get('benchmark_id', 'latest') + + click.echo(f"\nšŸ“ Output Files:") + + # Main results file + results_file = output_path / f"benchmark_{benchmark_id}.json" + click.echo(f" šŸ“„ Results: {results_file}") + + # Save results + import json + with open(results_file, 'w') as f: + json.dump(result, f, indent=2, default=str) + + # Check for additional files + metrics_file = output_path / f"metrics_{benchmark_id}.json" + if metrics_file.exists(): + click.echo(f" šŸ“Š Metrics: {metrics_file}") + + process_file = output_path / f"process_report_{benchmark_id}.json" + if process_file.exists(): + click.echo(f" šŸ”„ Process Report: {process_file}") + + # Summary + click.echo(f"\nšŸ“ˆ Summary:") + click.echo(f" {result.get('summary', 'Benchmark completed successfully')}") + if ctx.obj.get('verbose'): - click.echo(f"šŸ“‹ Summary: {result.get('summary', 'N/A')}") + click.echo(f"\nšŸ” Detailed Results:") + click.echo(json.dumps(result.get('metrics', {}), indent=2, default=str)) + + click.echo(f"{'='*60}\n") else: click.echo("āŒ Real benchmark failed!") return 1