GeezerVison is showing github.com — query: report the last node's query time and fix the percentage-view anomaly rate by stelfrag · Pull Request #24460 · netdata/netdata
Conversation
stelfrag
commented
Oct 28, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Two query fixes for issues reported in #14797:
- Per-node query time missing for the last node.
rrd2rrdr() closed a node's duration only when the next node started, so the last (or only) node in summary.nodes[] never got its st.ms. The duration is now closed after the loop.
- Anomaly rate wrong with
options=percentage. The percentage conversion rebuilt the dimension view's anomaly_count by multiplying the averaged anomaly rate by the row count, which inflated sts.arp. It now uses the same formula as finalize and the cardinality limit.
Query corpus:
L5/anomaly-statistics-percentage and L5/summary-node-duration fail on master and pass with the fix.
- The v2/v3 parity check now ignores
summary.nodes[].st.ms, which is wall-clock time like the timings it already ignores.
Summary by CodeRabbit
- Bug Fixes
- Corrected anomaly statistics in percentage-mode query results so reported anomaly rates are not scaled by the number of data rows.
- Query summaries now report duration for every queried node, including the final node and queries with only one node. These durations are available alongside total query timing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…anomaly rate
The per-node query time was stored only when the next node started, so the last node of every query had no ms. With options=percentage the per-dimension anomaly count was scaled by the row count instead of the dview multiplier, reporting sum(row rates)/10 instead of their mean. Corpus contracts cover both.
coderabbitai
Bot
commented
Oct 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5884e97a-7fcd-4b87-8e86-de20e2a9203b
Commits
-
Reviewing files that changed from the base of the PR and between 77e14ca and 646468f.
Files selected for processing: 7
-
src/web/api/queries/query-group-by-finalize.c
src/web/api/queries/query.c
tests/query-corpus/MANIFEST.md
tests/query-corpus/anomalybit_test.go
tests/query-corpus/layer9_test.go
tests/query-corpus/manifest.json
tests/query-corpus/summary_nodes_test.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Walkthrough
-
The query code changes how the v2 view calculates anomaly counts and records the final query node’s duration. Query-corpus tests and manifest cases cover percentage-mode anomaly statistics and per-node duration reporting.
Changes: Query reporting
| Layer / File(s) |
Summary |
Anomaly statistics src/web/api/queries/query-group-by-finalize.c, tests/query-corpus/anomalybit_test.go, tests/query-corpus/manifest.json |
The v2 view’s anomaly count now scales the accumulated anomaly rate instead of multiplying it by the row count. A test checks the arp statistics in percentage mode. |
Node duration reporting src/web/api/queries/query.c, tests/query-corpus/summary_nodes_test.go, tests/query-corpus/layer9_test.go, tests/query-corpus/MANIFEST.md, tests/query-corpus/manifest.json |
rrd2rrdr records elapsed time for the final node. Tests check that node durations are positive and bounded by total query time. The API parity test excludes node durations from response comparisons. |
Priority: Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- netdata/netdata#24369: Extends query-corpus coverage and changes query tests, which this PR continues with cases for anomaly statistics and node durations.
Suggested reviewers: vkalintiris, ktsaou
Merge Risk: Minimal · up to 64646
-
The change corrects percentage anomaly rates and final-node duration reporting. No material merge-blocking risk was identified.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly describes both primary changes: reporting the final node's query time and correcting the percentage-view anomaly rate. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 5 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
PR is running as expected. LGTM!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
stelfrag
added a commit
to stelfrag/netdata
that referenced
this pull request
Oct 30, 2026
…anomaly rate (netdata#24460)
The per-node query time was stored only when the next node started, so the last node of every query had no ms. With options=percentage the per-dimension anomaly count was scaled by the row count instead of the dview multiplier, reporting sum(row rates)/10 instead of their mean. Corpus contracts cover both.
(cherry picked from commit d05b8ed)
Ferroin
pushed a commit
that referenced
this pull request
Nov 4, 2026
…anomaly rate (#24460)
The per-node query time was stored only when the next node started, so the last node of every query had no ms. With options=percentage the per-dimension anomaly count was scaled by the row count instead of the dview multiplier, reporting sum(row rates)/10 instead of their mean. Corpus contracts cover both.
(cherry picked from commit d05b8ed)
Reviewers
Ancairon
Awaiting requested review from Ancairon
Ancairon is a code owner
vkalintiris
Awaiting requested review from vkalintiris
vkalintiris is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|