using SQLInsight.Rules.Availability; using SQLInsight.Rules.Concurrency; using SQLInsight.Rules.Configuration; using SQLInsight.Rules.Databases; using SQLInsight.Rules.Engine; using SQLInsight.Rules.Indexes; using SQLInsight.Rules.Instance; using SQLInsight.Rules.Lifecycle; using SQLInsight.Rules.Performance; using SQLInsight.Rules.Security; namespace SQLInsight.Rules; public static class BuiltInRules { /// The rule pack behind the version rules; the embedded one if null. public static IReadOnlyList Create(RuleKnowledge? knowledge = null) { knowledge ??= RuleKnowledge.Embedded(); return [ // Version new SupportLifecycleRule(knowledge), new PatchLevelRule(knowledge), // Configuration new MaxServerMemoryDefaultRule(), new MaxServerMemoryTooHighRule(), new CostThresholdRule(), new MaxDopRule(), new OptimizeForAdHocRule(), .. SimpleConfigurationRules.Create(), new PendingConfigurationRule(), new DeadlockTraceFlagRule(), new ConfigurationChangedRule(), new NewPrivilegeRule(), new TooManySysadminsRule(), // Databases new DatabaseStateRule(), .. SimpleDatabaseRules.Create(), new CompatibilityLevelRule(), new FullBackupRule(), new LogBackupRule(), new CheckDbRule(), new SuspectPagesRule(), new VirtualLogFileRule(), new FileGrowthRule(), new FileMaxSizeRule(), new QueryStoreStateRule(), new TempdbFilesRule(), // Performance .. WaitRules.Create(), new DataFileReadLatencyRule(), new LogFileWriteLatencyRule(), new CpuRule(), new ConstantActivityRule(), new SlowBackupRule(), new CorruptionErrorRule(), new SlowIoErrorRule(), new SevereErrorRule(), new LoginFailureBurstRule(), new StackDumpRule(), new AvailabilityGroupErrorRule(), new LongTransactionRule(), new LargeTransactionRule(), new LongRunningStatementRule(), new VersionStoreRule(), new TempdbFullRule(), new TempdbSessionRule(), new StoppedServiceRule(), new ReplicationAgentFailedRule(), new ReplicationLatencyRule(), new ClusterMemberDownRule(), new MemoryGrantsPendingRule(), new AnomalyRule(), new PlanRegressionRule(), new FailedForcedPlanRule(), new ParameterSensitivityRule(), new ImplicitConversionRule(), new NoJoinPredicateRule(), new ScalarUdfRule(), new SpillRule(), new ExcessiveGrantRule(), // Indexes and statistics new MissingIndexRule(), new UnusedIndexRule(), new DuplicateIndexRule(), new ForwardedRecordsRule(), new StaleStatisticsRule(), new AutoStatisticsRule(), // Availability and jobs new AvailabilityGroupHealthRule(), new AvailabilityGroupLagRule(), new FailedJobRule(), new AgentStoppedRule(), // Concurrency new BlockingRule(), new DeadlockRule(), ]; } }