feat: 分时段轮询(营业 2s / 出单后 1.5s 追击 / 非营业 8s)+ 端到端延迟指标
- 实测订单接口平均 300ms,2.5 次/秒连续 20 次无限流,故营业时段可压到 2 秒 - 商家后台 JS 无 WebSocket/SSE/socket.io/MQTT(0 命中)→ 平台不推,只能轮询 - 出单后 60 秒内自动加密到 1.5 秒(出单常成串),窗口结束回落 - 新增 last_detect_lag_sec:以订单 payTime 计算「支付→检出」真实延迟,写入 state 并暴露在 /healthz - 新增 6 项节奏测试(共 30 项全绿) - 修复 login_url 折行产生空格、上传内网绕过系统代理、新增 --upload-only 补传
This commit is contained in:
1 parent
4ad6ecd5c9
commit
88f7183554
7 files changed
+187
-3
No files matched your search
@@ -17,7 +17,7 @@
|
||||
服务器 Docker ┌──────────────────────────────┐
|
||||
fengxiang-monitor │ admin.py :8089 /healthz │
|
||||
│ monitor.py 主循环 │
|
||||
│ ├─ client.py → 丰享订单 API │ ← 5~10s 轮询
|
||||
│ ├─ client.py → 丰享订单 API │ ← 营业 2s / 出单后 1.5s 轮询
|
||||
│ ├─ store.py 状态去重 │
|
||||
│ └─ notify.py → 企业微信 │
|
||||
└──────────────────────────────┘
|
||||
@@ -152,7 +152,12 @@ docker compose up -d --build # 改代码后
|
||||
|
||||
| 配置 | 默认 | 说明 |
|
||||
|------|------|------|
|
||||
| `polling.interval_min/max` | 5 / 10 | 轮询间隔(秒,随机取值) |
|
||||
| `polling.business_hours` | 9-21 | 营业时段 |
|
||||
| `polling.interval_business` | 2 | 营业时段轮询间隔(秒) |
|
||||
| `polling.interval_idle` | 8 | 非营业时段间隔(秒) |
|
||||
| `polling.interval_burst` | 1.5 | 刚出单后的追击间隔(秒) |
|
||||
| `polling.burst_window_sec` | 60 | 追击窗口(出单常成串) |
|
||||
| `polling.interval_min/max` | 5 / 10 | 旧版随机间隔,缺 `interval_business` 时兜底 |
|
||||
| `polling.peak_page_size` | 20 | 高峰时段每次拉取条数 |
|
||||
| `polling.idle_page_size` | 5 | 闲时拉取条数 |
|
||||
| `polling.night_start/end` | 21:00 / 07:40 | 夜间暂停区间 |
|
||||
|
||||
Reference in new issue
Block a user