feat: 增加 sub2api 风格日志与性能统计页面 - #2
Merged
Merged
Conversation
新增可嵌入的 sub2api 风格统计、日志和配置页;使用最近 100 条内存环形日志记录四个关键时间点与阶段耗时,并提供统计聚合 API、主题同步和完整中文文档。
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.
变更概览
本次迭代针对嵌入 sub2api 自定义页面和审计链路性能可观测性进行完善:
页面与嵌入
运行统计、处理日志、节点配置三个页签?embedded=1iframe 嵌入布局<html>.dark;跨域时支持postMessage同步主题sub2api-auditer:resize动态高度事件frame-ancestors最近 100 条处理日志
perf_counter_ns单调时钟统计
统计严格从同一份最近 100 条日志实时聚合:
API 与部署
GET /api/logs?limit=100DELETE /api/logsGET /api/statisticsLOG_CAPACITY、HTTP_MAX_CONNECTIONS、HTTP_MAX_KEEPALIVE环境变量1.1.0验证
本地验证结果:
PYTHONPATH=src pytest -q:18 passedpython -m compileall -q src tests:通过node --check src/sub2api_auditer/static/app.js:通过