WS3: percent-autogrowth-on-large-files config recommendation#1066
Merged
Conversation
First WS3 catalog fact for the recommendations-engine rebuild. Flags large (>= 10 GB) data/log files set to PERCENTAGE autogrowth — a % growth on a big file is a single huge, stalling allocation — and recommends switching to a size-tiered fixed-MB FILEGROWTH. Advise + copy-paste only this PR (no Apply: no handler is registered for the FILE_AUTOGROWTH_PERCENT fact key). Mirrors the existing DB_CONFIG config-advisory pattern end to end: - Collectors: new FILE_AUTOGROWTH_PERCENT fact (Source "config") from collect.database_size_stats (Dashboard) / database_size_stats (Lite), latest row per file, system DBs excluded; metadata carries file/db counts. - Scoring: new "config"-source scorer arm scores it base 0.3 (advisory), below the 0.5 incident threshold; all other config-source leaf/amplifier facts keep scoring 0 exactly as before. - Advice: authored AdviceBlock (Headline/Investigation/Remediation). - Drill-down: lists offending files with a per-file copy-paste ALTER DATABASE ... MODIFY FILE built from a SHARED renderer (collector and reader render byte-identical statements); collected below the 0.5 gate. - Rooting: added FILE_AUTOGROWTH_PERCENT to ConfigAdvisoryRootKeys so it roots standalone at 0.3. - Reader: copy-paste flows through MapEngineFinding via a persisted advisory RemediationAction carrying typed FileGrowthTargets (the drill-down is ephemeral / not read back) — round-trips through AlertContextSerializer. - MCP next-tool maps updated for parity (both apps). Tests: scorer (0.3 when files present, 0 when none), advice-block-exists, standalone rooting at 0.3, reader copy-paste + MapEngineFinding, serialize/ deserialize round-trip, and Lite collector emission smoke tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Scope
First WS3 catalog fact for the recommendations-engine rebuild: a percent-autogrowth-on-large-files config recommendation. Flags data/log files that are large (
total_size_mb >= 10240, i.e. 10 GB) AND on PERCENTAGE autogrowth (is_percent_growth = 1) — a % growth on a big file is a single huge allocation that stalls writes — and recommends switching to a size-tiered fixed-MBFILEGROWTH. System DBs (master/msdb/model/tempdb) excluded; both data and log files included (labelled byfile_type_desc).Advise + copy-paste ONLY this PR — no Apply. No handler is registered for the
FILE_AUTOGROWTH_PERCENTfact key, soHasHandlerForreturns false → no Apply button, no destructive-consent path. The fact mirrors the existingDB_CONFIGconfig-advisory pattern end to end.Size tiers for the suggested fixed
FILEGROWTH: 256 MB (10–50 GB), 512 MB (50–200 GB), 1024 MB (> 200 GB) — a starting point the advice tells the operator to tune.File:line changelog
Shared analysis (
PerformanceMonitor.Analysis)RemediationAction.cs:36—FileGrowthTargetstrailing optional ctor param;:147newFileGrowthTargetrecord (advisory-only carrier).FactScorer.cs:36—"config"dispatch arm;:246ScoreConfigFact(base 0.3 forFILE_AUTOGROWTH_PERCENTwhenfile_count > 0, 0 otherwise; every other config-source fact still scores 0).InferenceEngine.cs:40—FILE_AUTOGROWTH_PERCENTadded toConfigAdvisoryRootKeys(roots standalone at 0.3).FactAdvice.cs:428— authoredt["FILE_AUTOGROWTH_PERCENT"]AdviceBlock (Headline "Large file(s) growing in percentage steps").FactRemediation.cs:42GenerateForFindingarm;:107BuildFileAutogrowthAction;:617ExtractFileGrowthTargets;:668GenerateForFileAutogrowth;:686RecommendedGrowthMbFor(tier);:700BuildModifyFileStatement(shared QUOTENAME renderer).Notifications (
PerformanceMonitor.Notifications)AlertContext.cs:86RemediationActionDto.FileGrowthTargets;:150FileGrowthTargetDto;ToDto/FromDtobranches so the advisory action round-trips throughremediation_action_json.Dashboard
Analysis/SqlServerFactCollector.cs:50pipeline wire;:1551CollectFileAutogrowthFactsAsync(readscollect.database_size_stats, parameterized@minSizeMb).Analysis/SqlServerDrillDownCollector.cs:58pre-0.5-gate dispatch;:806CollectAutogrowthPercentFiles(emitsautogrowth_percent_fileswith per-file detail +alter_statementvia the shared renderer,TOP (50)).Analysis/AnalysisService.cs:171?? BuildFileAutogrowthAction(finding)in the action-build chain.Services/Recommendations/RecommendationsReader.cs:250BuildCopyPasteFromActionrenders MODIFY FILE fromFileGrowthTargets(SettingFromActionalready returnsNone→ never de-dupes).Mcp/McpAnalysisTools.cs:456next-tool map entry.Lite (advise/copy-paste only; drill-down is the fix surface — no action persisted)
Analysis/DuckDbFactCollector.cs:50pipeline wire;:1446CollectFileAutogrowthFactsAsync(readsdatabase_size_stats,$1server filter).Analysis/DrillDownCollector.cs:56pre-0.5-gate dispatch;:846CollectAutogrowthPercentFiles(readsv_database_size_stats).Analysis/TestDataSeeder.cs:1819SeedPercentAutogrowthFilesAsync(test helper).Mcp/McpAnalysisTools.cs:792next-tool map entry.Tests
Dashboard.Tests/FactScorerTests.cs— scorer 0.3-when-files / 0-when-none, advice-block-exists.Dashboard.Tests/InferenceEngineTests.cs—FileAutogrowthPercentFact_RootsStandalone_BelowMinimumSeverity.Dashboard.Tests/RecommendationDeduperTests.cs—BuildCopyPasteFromActionMODIFY FILE rendering +MapEngineFindingcarries copy-paste /Setting == None.Dashboard.Tests/AnalysisNotificationTests.cs— build-from-drill-down +SerializeAction/DeserializeActionround-trip.Lite.Tests/FactCollectorTests.cs— collector emission smoke tests (qualifying-only; absent-when-none) against the real DuckDB schema.Test counts (real,
--no-build)AzureAuthConnectionStringTests.UpdateServer_ServicePrincipalToEntraMfa_BlankUsername_DeletesOrphanedSecretpassed in-suite this run.)dotnet build PerformanceMonitor.sln -c Debug: 0 warnings, 0 errors.Needs integration verification (live server, e.g. sql2022)
The SQL collection + drill-down need a server with a real large percent-growth file; not exercised by the unit suite:
CollectFileAutogrowthFactsAsyncactually emits theFILE_AUTOGROWTH_PERCENTfact on a server whosecollect.database_size_statshas a>= 10 GBfile withis_percent_growth = 1in a user DB.autogrowth_percent_filesdrill-down lists the file(s) with a valid copy-pasteALTER DATABASE ... MODIFY FILEstatement.config.analysis_findings.remediation_action_jsonand the Recommendations reader'sCopyPasteSqlcarries the MODIFY FILE text on read.🤖 Generated with Claude Code