修复网关流量折线图数据口径错误 - #256
Open
mcxinyu wants to merge 2 commits into
Hidden character warning
The head ref may contain hidden characters: "fix/\u4fee\u590d\u7f51\u5173\u6d41\u91cf\u5f02\u5e38"
Open
修复网关流量折线图数据口径错误#256mcxinyu wants to merge 2 commits into
mcxinyu wants to merge 2 commits into
Conversation
- 成功/失败折线各自取自己的计数,不再都跟随总请求数 - 失败面积和折线改用 requests - okCount,覆盖全部未成功请求(error/incomplete/canceled),避免曲线丢数据 - 添加 .gitattributes 强制 LF 换行,消除 Windows 构建产物哈希漂移问题
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.
Problem
概览页的流量折线图存在显示错误。成功和失败两条折线在大部分时间段几乎重合,看起来数据一模一样。
根本原因:红色失败折线错误地使用了
requests(总请求数)作为数据源,导致它和成功折线都反映总量,而非各自的实际计数。Solution
修复
TrafficChart.tsx中的数据计算逻辑:okCount(后端ok字段,缺省用requests - error兜底)errorCount(=requests - okCount),涵盖 error、incomplete、canceled 等所有未成功状态同时调整面积图的绘制顺序,确保失败区域正确叠加在底部。
相关变更:
.gitattributes统一换行符(LF),避免跨平台构建产物哈希漂移.opencode/.gitignore忽略 images 子目录Testing