ISP Throttle Detective
Scripts live in scripts/. Log and config default to ~/.isp-throttle-detective/. See references/setup-guide.md for full setup, scheduling, and interpretation guidance.
Workflow
Run a single test and log it
CODEBLOCK0
Analyze patterns (needs ≥5 tests across multiple hours/days)
CODEBLOCK1
Generate evidence report
CODEBLOCK2
Scripts
| Script | Purpose |
|---|
| INLINECODE3 | Download from 3 endpoints + upload to Cloudflare. Outputs JSON to stdout. |
| INLINECODE4 |
Append speedtest JSON to JSONL log with hour, day
ofweek enrichment. |
|
analyze.py | Detect peak vs off-peak, CDN discrimination, trend, anomalies. |
|
report.py | Generate markdown evidence report with tables and plain-English conclusion. |
Configuration
Copy assets/config.example.json to ~/.isp-throttle-detective/config.json. All scripts auto-detect it. Key fields:
- -
log_file — where the JSONL log lives - INLINECODE10 — add/remove test targets; set
category: "cdn" vs "general" to enable CDN discrimination detection - INLINECODE13 — list of hours (0–23) considered peak
Pass --config /path/to/config.json to any script to override.
Scheduling
See references/setup-guide.md for launchd (macOS) and cron (Linux) snippets. Recommended: every 30 minutes for meaningful data within a day or two.
Throttling Signals
- - Peak-hour drop >20% vs off-peak → time-based throttling
- CDN speed <75% of general internet → destination-based throttling
- Declining trend slope → infrastructure degradation
- Multiple low-speed anomalies at the same hour → systematic, not random
Using the Evidence Report
INLINECODE16 produces a markdown file with a peak/off-peak comparison table, per-endpoint breakdown, hourly chart, trend analysis, and a plain-English conclusion. Share it directly with ISP support or use it to evaluate whether upgrading your plan would actually help (if CDN throttling is confirmed, a faster plan won't fix it).
ISP 限速侦探
脚本位于 scripts/ 目录下。日志和配置文件默认存储在 ~/.isp-throttle-detective/ 目录中。完整设置、调度和解读指南请参阅 references/setup-guide.md。
工作流程
运行单次测试并记录结果
bash
python3 scripts/speedtest.py | python3 scripts/log_result.py
分析模式(需要跨多小时/多天的≥5次测试)
bash
python3 scripts/analyze.py
python3 scripts/analyze.py --days 30 --json # 机器可读格式
生成证据报告
bash
python3 scripts/report.py --days 30 --out ~/report.md
脚本说明
| 脚本 | 用途 |
|---|
| speedtest.py | 从3个端点下载 + 上传至Cloudflare。输出JSON到标准输出。 |
| log_result.py |
将测速JSON追加到JSONL日志中,并补充小时、星期几信息。 |
| analyze.py | 检测高峰与非高峰差异、CDN歧视、趋势、异常。 |
| report.py | 生成包含表格和通俗结论的Markdown证据报告。 |
配置
将 assets/config.example.json 复制到 ~/.isp-throttle-detective/config.json。所有脚本会自动检测该文件。关键字段:
- - logfile — JSONL日志的存储位置
- endpoints — 添加/删除测试目标;设置 category: cdn 或 general 以启用CDN歧视检测
- peakhours — 被视为高峰时段的小时列表(0–23)
向任意脚本传递 --config /path/to/config.json 参数可覆盖默认配置。
调度
请参阅 references/setup-guide.md 获取launchd(macOS)和cron(Linux)的配置片段。建议:每30分钟运行一次,以便在一两天内收集到有意义的数据。
限速信号
- - 高峰时段速度比非高峰时段下降>20% → 基于时间的限速
- CDN速度低于普通互联网速度的75% → 基于目的地的限速
- 趋势斜率持续下降 → 基础设施退化
- 同一小时出现多次低速异常 → 系统性而非随机性问题
使用证据报告
report.py 生成一个Markdown文件,包含高峰/非高峰对比表、各端点细分、小时图表、趋势分析以及通俗结论。可直接与ISP支持人员分享,或用于评估升级套餐是否真正有效(如果确认存在CDN限速,更快的套餐也无法解决该问题)。