feat(go): batch tdengine history writes
This commit is contained in:
@@ -406,6 +406,25 @@ vehicle_async_sink_queue_depth{sink}
|
||||
|
||||
这些指标是进入带帧率压测前的关键保护栏:如果 `queue_depth` 持续增长或 `enqueue_total{status="timeout"}` 增长,说明入口 publish 队列已成为瓶颈。
|
||||
|
||||
### History writer TDengine 批写
|
||||
|
||||
2026-07-03 已实现 history-writer 第一阶段批写:
|
||||
|
||||
- `history.Writer.AppendAllBatch` 按 TDengine child table 聚合 raw/location 多行 `INSERT`。
|
||||
- `cmd/history-writer` 默认 `HISTORY_BATCH_SIZE=200`、`HISTORY_BATCH_WAIT_MS=100`。
|
||||
- TDengine batch 成功后才批量提交 Kafka messages;失败不提交 offset。
|
||||
- 保留单条 `AppendAll` 路径作为回退。
|
||||
|
||||
新增指标:
|
||||
|
||||
```text
|
||||
vehicle_history_batch_flush_total{status}
|
||||
vehicle_history_batch_rows_total{status}
|
||||
vehicle_history_batch_flush_duration_ms{status}
|
||||
```
|
||||
|
||||
进入带帧率压测时,必须同时观察 `vehicle_history_kafka_lag` 和 `vehicle_history_batch_*`。
|
||||
|
||||
## 下次恢复上下文时先做
|
||||
|
||||
1. 读本文件。
|
||||
|
||||
Reference in New Issue
Block a user