taolib.symphony.observability.snapshot#
运行时快照生成。
生成系统状态的完整快照,用于 HTTP API 和调试。 快照包含运行中的 worker、重试队列、令牌汇总和配置参数。
Classes#
系统运行时快照。 |
|
运行中 worker 的摘要信息。 |
|
重试队列条目。 |
|
从 OrchestratorState 生成快照。 |
Module Contents#
- class taolib.symphony.observability.snapshot.SystemSnapshot#
系统运行时快照。
- running#
运行中的 worker 信息列表。
- retrying#
重试队列条目列表。
- completed_count#
已完成的问题数。
- codex_totals#
令牌用量与运行时间汇总。
- rate_limits#
当前速率限制状态(可能为 None)。
- poll_interval_ms#
当前轮询间隔(毫秒)。
- max_concurrent_agents#
最大并发代理数。
- poll_check_in_progress#
是否正在执行轮询检查。
- next_poll_due_at_ms#
下次轮询到期时间(单调时钟毫秒)。
- generated_at#
快照生成时间(ISO 8601)。
- class taolib.symphony.observability.snapshot.RunningEntry#
运行中 worker 的摘要信息。
- class taolib.symphony.observability.snapshot.RetryEntry#
重试队列条目。
- class taolib.symphony.observability.snapshot.SnapshotGenerator#
从 OrchestratorState 生成快照。
SnapshotGenerator 接收编排器的运行时状态,将其投影为 可 JSON 序列化的 SystemSnapshot 对象,供 HTTP API 和仪表板使用。
- generate(state: Any) SystemSnapshot#
从编排器状态生成系统快照。
- 参数:
state -- 编排器运行时状态对象,需要包含以下属性: - running: dict[str, RunningEntry] — 运行中的 worker 映射 - retry_attempts: dict[str, RetryEntry] — 重试队列映射 - completed: set[str] — 已完成的问题 ID 集合 - codex_totals: TokenUsage — 令牌用量汇总 - codex_rate_limits: dict | None — 速率限制 - poll_interval_ms: int — 轮询间隔 - max_concurrent_agents: int — 最大并发数
- 返回:
SystemSnapshot 实例。