| 201 | return "\n".join(lines) |
| 202 | |
| 203 | def parse_args(): |
| 204 | ap = argparse.ArgumentParser(description="SOCKS5 concurrency test for dynamic prewarm observation") |
| 205 | g = ap.add_mutually_exclusive_group(required=True) |
| 206 | g.add_argument("-c","--concurrency", type=int, help="固定并发数") |
| 207 | g.add_argument("-r","--ramp", help="分阶段并发列表, 例如: 50,100,200") |
| 208 | ap.add_argument("-t","--total", type=int, help="总请求数(固定并发模式必须)") |
| 209 | ap.add_argument("--per-stage", type=int, help="每个阶段请求数(ramp 模式必须)") |
| 210 | ap.add_argument("--timeout", type=float, default=5.0, help="单请求超时秒") |
| 211 | ap.add_argument("--jitter", type=float, default=0.0, help="启动抖动最大秒 (0~1 小幅随机延迟)") |
| 212 | ap.add_argument("--save", help="保存所有结果为 JSON 文件") |
| 213 | ap.add_argument("--seed", type=int, help="随机种子") |
| 214 | return ap.parse_args() |
| 215 | |
| 216 | def print_header(): |
| 217 | print("="*70) |