-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Which component(s) does this affect?
- Full Dashboard
- Lite
- SQL collection scripts
- Installer
- Documentation
Problem Statement
The Dashboard and Lite apps currently use a hard-coded "cool down" period which limits the frequency of pop-up alerts and email alerts. This feature adds a user-configurable period via the Settings windows in each app.
Proposed Solution
Plan for branch: feature/add-cooldown-period-setting
The cooldown is currently private static readonly TimeSpan AlertCooldown = TimeSpan.FromMinutes(5) in both MainWindow.xaml.cs files (Dashboard line 63, Lite line 46). It's used at 7 comparison sites in each edition (one per alert type: blocking, deadlock, CPU, poison waits, long-running queries, TempDB space, long-running jobs).
What changes
Dashboard — uses UserPreferences for all alert settings:
Dashboard/Models/UserPreferences.cs— addpublic int AlertCooldownMinutes { get; set; } = 5;Dashboard/MainWindow.xaml.cs— remove thestatic readonly field;introducevar alertCooldown = TimeSpan.FromMinutes(prefs.AlertCooldownMinutes);as a local at the top ofEvaluateAlertConditionsAsync(where prefs is already fetched), replace all 7 AlertCooldown usages with itDashboard/SettingsWindow.xaml— add AlertCooldownTextBox + label before the per-alert-type rowsDashboard/SettingsWindow.xaml.cs— load fromprefs.AlertCooldownMinutes, save with 1–60 validation, restore default = 5
Lite — uses App.xaml.cs static properties + JSON:
Lite/App.xaml.cs— addpublic static int AlertCooldownMinutes { get; set; } = 5;, load from alert_cooldown_minutes (clamped 1–60), save to JSONLite/MainWindow.xaml.cs— removestatic readonlyfield; addvar alertCooldown = TimeSpan.FromMinutes(App.AlertCooldownMinutes);at top ofCheckPerformanceAlerts, replace all 7 usagesLite/Windows/SettingsWindow.xaml— add AlertCooldownBox + labelLite/Windows/SettingsWindow.xaml.cs— load/save/restore pattern matching existing settings
One important non-change: GetFilteredDeadlockCountAsync has its own 5-minute SQL window — that's a data collection window, completely separate from the notification cooldown, and stays hardcoded.
Use Case
Personally, I would like to limit the frequency of alerts to be either:
(a) shorter to allow easier testing of changes to the alerts code
(b) allow the user to limit emails/alert popups to once per hour or whatever they think is helpful for their situation.
Alternatives Considered
No response
Additional Context
No response