Repository navigation
功能:补齐语义 MCP 与 SQL 分阶段性能观测 - #5
Open
qingfengyuhuan wants to merge 1 commit into
Open
qingfengyuhuan wants to merge 1 commit into
qingfengyuhuan wants to merge 1 commit into
Conversation
为 MCP 调用、语义召回、发布口径装配、SQL 校验、EXPLAIN、连接池、建连、执行和结果提取增加计时。 通过 MCP 进度通知和结果元数据上报阶段轨迹,供 Codata 性能瀑布与节点详情使用。 保留直接调用返回契约,观测故障不会将成功业务查询改为失败。 仅包含性能采集生产代码,排除测试、测试数据和 API 数据源规划。 验证暂存区独立副本:152 项后端测试通过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与效果
语义 MCP 查询此前缺少可关联的阶段耗时,客户端看到一个工具总耗时后,难以区分身份校验、召回、口径装配、线程调度、数据库建连及 SQL 执行。本 PR 为这些实际执行步骤增加计时,并通过标准 MCP progress 通知和结果元数据上报,让客户端在执行中查看阶段状态、在完成后保留完整轨迹。
主要变更
list_models、search_semantic、get_model_context、query_indicator、execute_sql增加每请求独立的计时上下文;上下文可传入同步数据库线程。使用与边界
验证与范围
配套客户端效果
下面两张图展示与客户端性能分析配套后的最终界面;本后台 PR 提供其中的语义召回和 SQL 分阶段观测。图中耗时为一次具体执行,不代表性能提升对照。
性能瀑布
调用节点与详情
图片引用 fork 独立素材分支的固定提交,不进入本 PR 的功能代码差异。