Uh oh!
There was an error while loading. Please reload this page.
C#/Java/Rust: Improve database quality diagnostics query. - #20366
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
6b0657b to
cafe644CompareThere was a problem hiding this comment.
Pull Request Overview
This PR improves the database quality diagnostics message for C# by including specific health metrics in the diagnostic output. The enhancement provides users with concrete percentage values for call targets and expression types to help them better understand database quality issues.
Key changes:
- Enhanced diagnostic message to include specific database health metrics with percentage values
- Refactored the diagnostic creation logic to capture and display both call target and expression type statistics
- Updated expected test outputs to reflect the new message format
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| csharp/ql/src/change-notes/2025-09-04-database-diagnostics.md | Documents the enhancement to include database health metrics in diagnostic messages |
| csharp/ql/src/Telemetry/DatabaseQualityDiagnostics.ql | Refactors diagnostic logic to capture specific metrics and updates the diagnostic message format |
| csharp/ql/integration-tests/all-platforms/standalone/DatabaseQualityDiagnostics.expected | Updates expected test output to match the new diagnostic message format |
cafe644 to
02e2b65Compare02e2b65 to
70b3a46Compare| private string getDbHealth() { | ||
| result = | ||
| callMsg + ": " + callTargetOk.floor() + ". " + exprMsg + ": " + exprTypeOk.floor() + ". " |
There was a problem hiding this comment.
maybe
| callMsg+": "+callTargetOk.floor()+". "+exprMsg+": "+exprTypeOk.floor()+". " | |
| callMsg+": "+callTargetOk.floor()+"%. "+exprMsg+": "+exprTypeOk.floor()+"%. " |
?
| | | ||
| percentageGood < 95 | ||
| ) | ||
| TTheDbQualityDiagnostic(string callMsg, float callTargetOk, string exprMsg, float exprTypeOk) { |
There was a problem hiding this comment.
How about instead:
privatepredicatediagnostic(stringmsg,floatvalue,floatthreshold){
CallTargetStatsReport::percentageOfOk(msg,value)andthreshold=85or
ExprTypeStatsReport::percentageOfOk(msg,value)andthreshold=85}privatenewtypeTDbQualityDiagnostic=TTheDbQualityDiagnostic(){exists(floatpercentageGood,floatthreshold|diagnostic(_,percentageGood,threshold)andpercentageGood<threshold)}
...
privatestringgetDbHealth(){result=strictconcat(stringmsg,floatvalue,floatthreshold|diagnostic(msg,value,threshold)|msg+": "+value.floor()+" % (threshold "+threshold.floor()+" %)",". ")}There was a problem hiding this comment.
Yes, considering the discussion on the posibility of having different thresholds pr metric - then this looks very good.
I will address the review comments for C# and when we have reached consensus, I will update for the other languages as well (in this PR).
ae516ee to
29c22e6CompareUh oh!
There was an error while loading. Please reload this page.
No description provided.