Skip to content

Conversation

@coltea
Copy link
Collaborator

@coltea coltea commented Jan 7, 2026

PR 标题

fix(stats) 统计忽略无数据情况

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:

  1. feat(stats) 统计忽略无数据情况

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copilot AI review requested due to automatic review settings January 7, 2026 03:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds filtering to exclude empty/null values from statistics queries, preventing empty strings from being counted in hot referer hosts, browser names, and browser OS statistics.

Key Changes:

  • Added SQL-level filtering for empty browser names and OS values in database queries
  • Added runtime filtering for empty referer hosts, browser names, and OS values when merging aggregated hourly statistics
  • Applied consistent empty string checks across both real-time and aggregated statistics data

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
backend/repo/pg/stat.go Added SQL WHERE clauses to filter out empty referer_host, browser_name, and browser_os values in GetHotRefererHosts and GetHotBrowsers queries
backend/repo/pg/stat_hour.go Added runtime checks to filter empty strings when merging referer host data, and SQL WHERE clauses for browser/OS queries, plus runtime checks when processing aggregated hourly statistics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coltea coltea changed the title feat(stats) ignore null feat(stats) 统计忽略无数据情况 Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coltea coltea merged commit ecd6285 into chaitin:main Jan 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant