Skip to content

Batch game stat metrics into a single ClickHouse query - #1090

Merged
tudddorrr merged 1 commit into
developfrom
batch-stat-metrics-queries
Oct 9, 2026
Merged

tudddorrr merged 1 commit into
developfrom
batch-stat-metrics-queries

Conversation

@tudddorrr

Copy link
Copy Markdown
Collaborator

Batched metrics querying

  • Game stat metrics are now fetched in one ClickHouse query per list request instead of one query per stat
  • The new query groups snapshots by game_stat_id and returns global and player value aggregates together
  • Reduces round trips to ClickHouse and speeds up loading lists with metrics enabled

Per-stat metric attribution

  • Each returned row is mapped back to its stat so metrics stay isolated per stat
  • Stats with no snapshots still fall back to their own default values, including globalCount, since empty groups are dropped by GROUP BY

Shared metric building

  • Extracted aggregate SQL fragments and value-metric builders to avoid duplicating global/player aggregation logic across the single-stat and batch paths

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.73%. Comparing base (a04279b) to head (ea467e8).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1090      +/-   ##
===========================================
- Coverage    98.74%   98.73%   -0.02%     
===========================================
  Files          530      530              
  Lines         8139     8153      +14     
  Branches      1057     1059       +2     
===========================================
+ Hits          8037     8050      +13     
  Misses          36       36              
- Partials        66       67       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tudddorrr
tudddorrr force-pushed the batch-stat-metrics-queries branch from 79ee6b9 to ea467e8 Compare October 9, 2026 22:01
@tudddorrr
tudddorrr merged commit a9406b4 into develop Oct 9, 2026
9 checks passed
@tudddorrr
tudddorrr deleted the batch-stat-metrics-queries branch October 9, 2026 22:08
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