-
Notifications
You must be signed in to change notification settings - Fork 808
feat(stats) 统计忽略无数据情况 #1684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(stats) 统计忽略无数据情况 #1684
Conversation
There was a problem hiding this 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.
32572de to
76f3e76
Compare
There was a problem hiding this 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.
PR 标题
fix(stats) 统计忽略无数据情况
变更类型
请勾选适用的变更类型:
变更内容
详细描述本次 PR 的具体变更内容:
测试情况
描述本次变更的测试情况:
其他说明
任何其他需要说明的事项: