Repository navigation
feat: 历史接口返回 step,即每个点覆盖的秒数 - #86
Merged
Merged
Conversation
`/api/nodes/{id}/metrics` 的响应加上 `step`。`minutes` 的满额是 `step / 60`,主题此前只能从相邻时间戳推算,窗口里只有一个点时推不出来。新增字段,旧主题不受影响。
- 分桶按 `ts / step` 从 epoch 对齐,窗口起点改为向下对齐到 `step`,首个点覆盖完整的一段,满额 `minutes` 与 `step / 60` 一致 - 注明最后一个点是进行中的时段,`minutes` 只算到当前
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.
/api/nodes/{id}/metrics的响应加上step:每个点覆盖的秒数。minutes的满额是step / 60,主题此前只能从相邻时间戳推算,窗口里只有一个点时推不出来step:分桶从 epoch 对齐,起点落在桶中间时首个点只覆盖一部分,minutes达不到满额。点的时间戳不变,只是首个点的数据补全了minutes只算到当前测试
cargo fmt --check、cargo clippy --all-targets -- -D warnings、cargo test(132 个)通过step为 420(1440 点预算下 7 分钟一个点),30 天窗口为 3600minutes都是满额,且没有点早于窗口起点;去掉对齐时它失败配套:文档 monitor-probe/monitor-document#34