Skip to content

[Feature] Add skills and logging cleanup#7362

Open
mouxinqq wants to merge 73 commits intoPaddlePaddle:developfrom
mouxinqq:develop
Open

[Feature] Add skills and logging cleanup#7362
mouxinqq wants to merge 73 commits intoPaddlePaddle:developfrom
mouxinqq:develop

Conversation

@mouxinqq
Copy link
Copy Markdown
Contributor

@mouxinqq mouxinqq commented Apr 13, 2026

Motivation

生产环境运行时需要自动清理过期日志文件,避免磁盘占用过多;同时需要统计 cache 命中率和综合问题排查能力,提升运维效率。

Modifications

  1. 日志滚动和清理功能

    • 实现 rotatingWriter 支持按天自动滚动日志文件
    • 新增 StartLogCleanup 定期清理过期日志(基于天数和总大小)
    • 支持 grace period 确保跨天日志的连续性
    • 旧版单文件自动迁移为按天滚动格式
  2. 配置项新增

    • log.max-age-days:日志保留天数,默认 7 天
    • log.max-total-size-mb:日志总大小限制(MB),默认 500MB
    • log.cleanup-interval-secs:清理检查间隔,默认 3600 秒
  3. 诊断 Skills

    • stat-cache-hitrate:统计三层 cache 命中率(Prefix Hit Ratio、Session Hit Rate、Per-Worker Stats)
    • troubleshoot:综合问题排查(错误分类、延迟分析、健康状态、负载分析、请求追踪)
  4. 文档更新:更新中英文 FAQ 文档,补充新增日志说明和错误信息

mouxin and others added 30 commits April 12, 2026 15:31
Enhance log parsing and troubleshoot analysis: robust URL handling, tail-by-minutes, improved select/release matching and reporting
Improve log parsing, URL handling, and detailed reporting for router troubleshooting skills
Enhance stat-cache-hitrate reports with legends and file:// links (path quoting)
…-path

Add session-level analysis and window-merging to stat-cache-hitrate skill
…-path-siyzne

stat-cache-hitrate: add session-level analysis and window merge compression
…-settings

Improve stat-cache-hitrate UX and normalize Total Running metric
…io-structure

Improve report readability and preserve run details with timestamped summary/detail folders
…io-structure-m2lbgv

Split report outputs into summary/detail, add session_id fallback and markdown report improvements
…-markdown-summary

Improve stat-cache-hitrate session details formatting
…o-markdown-summary-2h7tlo

Add time-range selection and improve session reports and table rendering for stat-cache-hitrate
…o-markdown-summary-j1wwvx

Enhance session reporting and table rendering; add time-range selection in skill metadata
…ser-input

Refactor load analyzer: extract report formatter, improve token/select-release parsing and worker-type handling
fastdeploy-bot

This comment was marked as outdated.

fastdeploy-bot

This comment was marked as outdated.

fastdeploy-bot

This comment was marked as outdated.

fastdeploy-bot

This comment was marked as outdated.

fastdeploy-bot

This comment was marked as outdated.

fastdeploy-bot

This comment was marked as outdated.

Copy link
Copy Markdown

@fastdeploy-bot fastdeploy-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Review | 2026-04-14

📋 Review 摘要

PR 概述:新增日志滚动清理功能和两个诊断 skills,提升生产环境运维效率
变更范围:pkg/logger、cmd/main.go、internal/config、docs、.claude/skills

📝 PR 规范检查

PR 标题和描述符合规范:

  • 标题包含 [Feature] Tag
  • 描述包含 Motivation 和 Modifications

问题

未发现阻塞性问题。

总体评价

代码实现质量良好,日志滚动和清理功能设计合理,跨天日志的 grace period 机制确保日志连续性。测试覆盖充分,包括日志级别、Context 前缀、parseLogDate、StartLogCleanup、跨天 rolling 等测试用例。两个诊断 skills(stat-cache-hitrate 和 troubleshoot)提供了实用的 cache 命中率统计和综合问题排查能力。文档更新完整,中英文 FAQ 文档同步补充了新增错误日志说明。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants