Modify System_Requests_C report to account for # of CPU on the system#487
Modify System_Requests_C report to account for # of CPU on the system#487
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the System_Requests_C SSRS report definition to normalize reported CPU utilization by the system’s CPU core count, and adjusts report text/formatting to reflect the new meaning of “CPU %”.
Changes:
- Added core-count lookup logic and normalized
cpu_percentcalculations by dividing by core count. - Updated report titles/labels/prompts and numeric formats to indicate normalized CPU%.
- Added a report footer/info row to display CPU core count.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| sqlnexus/Reports/System_Requests_C.rdlC | Normalizes CPU% by core count, updates UI text/formatting, and adds core-count display. |
| NexusReports/System_Requests_C.rdl | Same report updates mirrored in the report project output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| OR runtime < prev_runtime | ||
| THEN NULL | ||
| ELSE DATEDIFF_BIG(ms, prev_runtime, runtime) | ||
| END AS elapsed_ms |
There was a problem hiding this comment.
elapsed_ms is computed via DATEDIFF_BIG(ms, ...) (bigint) and returned as delta_elapse_time. The RDL field for delta_elapse_time is still typed as System.Int32 (from the previous DATEDIFF(ms, ...)), which can overflow/truncate for larger gaps and cause render errors. Either cast elapsed_ms back to int or update the field type to System.Int64.
| GROUP BY c2.command | ||
| HAVING | ||
| SUM(c2.delta_cpu) * 100.0 | ||
| / NULLIF(AVG(CONVERT(float, c2.elapsed_ms)), 0) |
There was a problem hiding this comment.
The command-threshold filter groups only by c2.command but computes CPU% using SUM(delta_cpu) / AVG(elapsed_ms). Over a multi-row time range this inflates CPU% roughly by the number of samples (since SUM/AVG scales with row count) and can cause incorrect filtering/ordering. Use a time-weighted denominator (e.g., SUM(elapsed_ms)) or reintroduce the prior grouping by (command, runtime) if the intent is per-sample thresholding.
| / NULLIF(AVG(CONVERT(float, c2.elapsed_ms)), 0) | |
| / NULLIF(SUM(CONVERT(float, c2.elapsed_ms)), 0) |
| OR runtime < prev_runtime | ||
| THEN NULL | ||
| ELSE DATEDIFF_BIG(ms, prev_runtime, runtime) | ||
| END AS elapsed_ms |
There was a problem hiding this comment.
elapsed_ms is computed via DATEDIFF_BIG(ms, ...) (bigint) and returned as delta_elapse_time. The RDL field for delta_elapse_time is still typed as System.Int32 (from the previous DATEDIFF(ms, ...)), which can overflow/truncate for larger gaps and cause render errors. Either cast elapsed_ms back to int or update the field type to System.Int64.
No description provided.