1938 - Add current-hour aggregation to fix db lag#2586
Merged
crivetimihai merged 1 commit intomainfrom Jan 31, 2026
Merged
Conversation
a5cf46f to
8b810dc
Compare
Fixes: #1938 This commit addresses an issue where admin metrics were empty during benchmark tests shorter than one hour because they relied on hourly rollup jobs. The metrics query service is updated to use a three-source aggregation: 1. Historical rollups (for data older than the retention period) 2. Raw metrics for completed hours within the retention period 3. Raw metrics from the current, incomplete hour This ensures that metrics are always up-to-date, even before the hourly rollup job runs, providing immediate visibility and preventing expensive raw table scans during short-lived tests. Test improvements: - Fix flaky test at hour boundary (race condition) - Remove unused patch import - Add tests for three-source merge behavior Signed-off-by: Gabriel Costa <gabrielcg@proton.me>
8b810dc to
d37edc5
Compare
crivetimihai
approved these changes
Jan 31, 2026
2 tasks
hughhennelly
pushed a commit
to hughhennelly/mcp-context-forge
that referenced
this pull request
Feb 8, 2026
Fixes: IBM#1938 This commit addresses an issue where admin metrics were empty during benchmark tests shorter than one hour because they relied on hourly rollup jobs. The metrics query service is updated to use a three-source aggregation: 1. Historical rollups (for data older than the retention period) 2. Raw metrics for completed hours within the retention period 3. Raw metrics from the current, incomplete hour This ensures that metrics are always up-to-date, even before the hourly rollup job runs, providing immediate visibility and preventing expensive raw table scans during short-lived tests. Test improvements: - Fix flaky test at hour boundary (race condition) - Remove unused patch import - Add tests for three-source merge behavior Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
kcostell06
pushed a commit
to kcostell06/mcp-context-forge
that referenced
this pull request
Feb 24, 2026
Fixes: IBM#1938 This commit addresses an issue where admin metrics were empty during benchmark tests shorter than one hour because they relied on hourly rollup jobs. The metrics query service is updated to use a three-source aggregation: 1. Historical rollups (for data older than the retention period) 2. Raw metrics for completed hours within the retention period 3. Raw metrics from the current, incomplete hour This ensures that metrics are always up-to-date, even before the hourly rollup job runs, providing immediate visibility and preventing expensive raw table scans during short-lived tests. Test improvements: - Fix flaky test at hour boundary (race condition) - Remove unused patch import - Add tests for three-source merge behavior Signed-off-by: Gabriel Costa <gabrielcg@proton.me>
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.
🐛 Bug-fix PR
📌 Summary
Fixes: #1938
This commit addresses an issue where admin metrics were empty during benchmark tests shorter than one hour because they relied on hourly rollup jobs. The metrics query service is updated to use a three-source aggregation:
strategy:
This ensures that metrics are always up-to-date, even before the expensive raw table scans during short-lived tests. hourly rollup job runs, providing immediate visibility and preventing.
🔁 Reproduction Steps
make load-tests-ui)/admin/metricsand/api/metrics🐞 Root Cause
When no rollups were found, the query was sent to the DB, further stressing it.
💡 Fix Description
Add rollups for the current hour, caching data and allowing for shorter duration load tests to display results data.
🧪 Verification
make lintmake testmake coverage✅ Checklist
make black isort pre-commit)