Skip to content

feat(webui): 入站调度观测面板#44

Merged
TogetsuDo merged 2 commits into
mainfrom
feat/ingress-dispatch-webui
Jun 15, 2026
Merged

feat(webui): 入站调度观测面板#44
TogetsuDo merged 2 commits into
mainfrom
feat/ingress-dispatch-webui

Conversation

@TogetsuDo

@TogetsuDo TogetsuDo commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • 首页分片 hub 入站调度面板与 worker 明细

Test plan

  • vue-tsc / build
  • CI 通过后 merge

Summary by Sourcery

在首页仪表盘中新增入口分发(ingress dispatch)可观测性面板,并将其连接到新的后端端点和类型定义。

新功能:

  • 在首页新增入口分发指标面板,展示整体 KPI,以及针对分片(sharded)和统一(unified)两种部署的按 worker 细分数据。
  • 暴露新的 /ingress-dispatch API 客户端,以及用于分发、队列和连接池指标的对应 TypeScript 模型。

增强与改进:

  • 调整首页和社区的加载流程,使社区统计数据独立获取,并将入口分发的加载纳入延迟加载的首页数据中。
  • 为仪表盘中的入口分发告警文案以及 PostgreSQL 连接池高占用情况添加警告样式。
Original summary in English

Summary by Sourcery

Add an ingress dispatch observability panel to the home dashboard and wire it to a new backend endpoint and type definitions.

New Features:

  • Introduce home page ingress dispatch metrics panel with overall KPIs and per-worker breakdown for both sharded and unified setups.
  • Expose a new /ingress-dispatch API client and corresponding TypeScript models for dispatch, queue, and pool metrics.

Enhancements:

  • Adjust home and community loading flows to fetch community statistics independently and make ingress dispatch loading part of deferred home data.
  • Add warning styling for ingress dispatch alert text and high PostgreSQL pool utilization in the dashboard.

首页 unified 模式展示 ingress-dispatch 指标;对接 GET /ingress-dispatch。
分片模式下展示 hub 汇总的 dispatch 指标及各 worker 漏斗。

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些高层次的反馈:

  • 当前 ingressDispatchVisible 计算属性只要在 shardObsVisible 为 false 时就会返回 true,即使此时尚未加载任何 ingressDispatch 数据,也会短暂渲染一个空面板;在显示该区块之前,建议同时检查是否存在有意义的 ingressDispatch 数据(例如 alerts、send_queue 或 totals)。
  • IngressDispatchWorker.ingress_dispatch 字段目前被标注为完整的 IngressDispatchData 类型,但看起来实际上只包含每个 worker 的子集数据(例如计数和延迟);将该类型收紧为更具体的 worker 级接口,可以让使用方式更清晰,并防止不小心依赖那些实际上从未出现的字段。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The `ingressDispatchVisible` computed currently returns `true` whenever `shardObsVisible` is false, even if no `ingressDispatch` data is loaded, which can briefly render an empty panel; consider also checking for the presence of meaningful `ingressDispatch` data (e.g. alerts, send_queue, or totals) before showing the section.
- The `IngressDispatchWorker.ingress_dispatch` field is typed as the full `IngressDispatchData`, but appears to contain only a per-worker subset (e.g. counts and latencies); tightening this type to a more specific worker-level interface would make usage clearer and prevent accidental reliance on fields that are never present.

Sourcery 对开源项目免费 —— 如果你喜欢我们的评审,请考虑分享给他人 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The ingressDispatchVisible computed currently returns true whenever shardObsVisible is false, even if no ingressDispatch data is loaded, which can briefly render an empty panel; consider also checking for the presence of meaningful ingressDispatch data (e.g. alerts, send_queue, or totals) before showing the section.
  • The IngressDispatchWorker.ingress_dispatch field is typed as the full IngressDispatchData, but appears to contain only a per-worker subset (e.g. counts and latencies); tightening this type to a more specific worker-level interface would make usage clearer and prevent accidental reliance on fields that are never present.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `ingressDispatchVisible` computed currently returns `true` whenever `shardObsVisible` is false, even if no `ingressDispatch` data is loaded, which can briefly render an empty panel; consider also checking for the presence of meaningful `ingressDispatch` data (e.g. alerts, send_queue, or totals) before showing the section.
- The `IngressDispatchWorker.ingress_dispatch` field is typed as the full `IngressDispatchData`, but appears to contain only a per-worker subset (e.g. counts and latencies); tightening this type to a more specific worker-level interface would make usage clearer and prevent accidental reliance on fields that are never present.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@TogetsuDo TogetsuDo merged commit dfc3fde into main Jun 15, 2026
2 checks passed
@TogetsuDo TogetsuDo deleted the feat/ingress-dispatch-webui branch June 15, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant