Repository navigation
feat: 历史记录保留每分钟的峰值网速 - #68
Merged
Merged
Conversation
历史行的网速是这一分钟的平均值,积分等于累计流量,但一次 15 秒的测速被摊到整分钟。 同一行另存这一分钟 agent 上报过的最高网速,接口每行多 net_rx_max / net_tx_max, 聚合成宽窗口时取桶内最大值。
This was referenced Sep 26, 2026
stqfdyr
added a commit
to monitor-probe/monitor-theme-default
that referenced
this pull request
Sep 27, 2026
网络速率图在平均值之外画出峰值。平均值线的积分等于累计流量,但一次 15 秒的测速在一分钟里只剩四分之一,在 7 天窗口里更低。 - 每条线后面画一条从平均值到峰值的带,上沿是 1 像素虚线:一分钟的突发在 24 小时的轴上不到一像素宽,只有填充时看不见 - Y 轴按峰值取顶;标题写出窗口内的峰值「网络速率 · 峰值 ↓ … · ↑ …」;悬停提示为「均值 … · 峰值 …」 - hub 不发 `net_rx_max` / `net_tx_max`(1.3.0 及更早)时,带没有高度、标题不写峰值,图与原来相同 ## 测试 - `tsc -b`、`oxlint`、`npm test` 通过 - 预览环境浏览器实测:真实测速(agent 只统计一对 veth,`tc` 限速 300 / 100 Mbit/s)和 7 天模拟数据(每天测一次速的空闲节点、持续大流量节点、升级前没有峰值的旧行),1 小时到 7 天四个窗口 × 浅色 / 深色 × 1280 / 390 宽度;拦截接口去掉峰值字段模拟旧 hub 需要 monitor-probe/monitor#68
stqfdyr
added a commit
to monitor-probe/monitor-theme-serverstatus
that referenced
this pull request
Sep 27, 2026
网络速率图在平均值之外画出峰值。平均值线的积分等于累计流量,但一次 15 秒的测速在一分钟里只剩四分之一,在 7 天窗口里更低。 - 每条线后面画一条从平均值到峰值的带,上沿是 1 像素虚线:一分钟的突发在 24 小时的轴上不到一像素宽,只有填充时看不见 - Y 轴按峰值取顶;标题的「● 下行」「● 上行」后面写出窗口内的峰值;悬停提示为「均值 … · 峰值 …」 - hub 不发 `net_rx_max` / `net_tx_max`(1.3.0 及更早)时,带没有高度、标题不写峰值,图与原来相同 ## 测试 - `tsc -b`、`oxlint`、`npm test` 通过 - 预览环境浏览器实测:真实测速(agent 只统计一对 veth,`tc` 限速 300 / 100 Mbit/s)和 7 天模拟数据(每天测一次速的空闲节点、持续大流量节点、升级前没有峰值的旧行),1 小时到 7 天四个窗口 × 浅色 / 深色 × 1280 / 390 宽度;拦截接口去掉峰值字段模拟旧 hub 需要 monitor-probe/monitor#68
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.
历史图的网速是每分钟的平均值,积分等于累计流量,但一次 15 秒的测速会被摊到整分钟:实测 286 Mbit/s 的突发,分钟行记 72.2 Mbit/s,7 天窗口里只剩 8–10 Mbit/s。
net_rx_max/net_tx_max),随同一条 INSERT 写入,不多一次提交。schema 升到 10,两列默认 0,回退到旧版 hub 照常写入/api/nodes/{id}/metrics每行多这两个字段。聚合成宽窗口时取桶内最大值,且不低于这一行的平均值,所以升级前没有峰值的行按平均值读测试
cargo fmt --check、cargo clippy --all-targets、cargo test(126 个)通过tc限速下行 300、上行 100 Mbit/s),同一分钟里跑 15 秒下行、15 秒上行。实时最高 287.8 / 96.2 Mbit/s,落库峰值 287.9 / 96.5,平均值仍是 72.2 / 25.0;1 小时到 7 天四个窗口的峰值一致;预览库从 schema 9 迁移正常主题:monitor-probe/monitor-theme-default#15、monitor-probe/monitor-theme-serverstatus#15;文档:monitor-probe/monitor-document#29