Skip to content

Add Off collection preset (#888)#891

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/888-off-preset
Apr 24, 2026
Merged

Add Off collection preset (#888)#891
erikdarlingdata merged 1 commit intodevfrom
feature/888-off-preset

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Adds a fourth value, Off, to config.apply_collection_preset. It sets enabled = 0 on every row in config.collection_schedule and returns — no frequency edits.
  • The three existing presets (Aggressive, Balanced, Low-Impact) now also set enabled = 1 across the board before applying their frequency tables. A switch from Off → Balanced therefore reliably resumes collection, including for daily/on-load collectors that aren't in the preset frequency list.
  • Updates the proc header comment, input validation list, PRINT summary, README blurb, and CHANGELOG.

Why this way

#888 lays out the reasoning: rather than invent a generic blackout/quiet-hours system (timezones, DST, midnight wrap-around, catch-up logic), use presets as the intensity+presence dial and let SQL Agent jobs compose time-of-day windows:

```sql
-- Agent job "Quiet hours - start" (schedule: daily 22:00)
EXECUTE config.apply_collection_preset @preset_name = N'Off';

-- Agent job "Quiet hours - end" (schedule: daily 06:00)
EXECUTE config.apply_collection_preset @preset_name = N'Balanced';
```

Zero new schema, zero new collector code, Agent owns time zones and DST, the switchover is a pair of idempotent UPDATE statements.

Test plan

Run the install script against a server, then:

```sql
-- starting state: 34/34 enabled
SELECT enabled_count = COUNT_BIG(*) FROM config.collection_schedule WHERE enabled = 1;

EXEC config.apply_collection_preset @preset_name = N'Off';
-- expected: "Applied "Off" collection preset (34 collectors disabled)"
SELECT enabled_count = COUNT_BIG(*) FROM config.collection_schedule WHERE enabled = 1;
-- expected: 0/34

EXEC config.apply_collection_preset @preset_name = N'Balanced';
-- expected: "Applied "Balanced" collection preset (29 collectors updated)"
SELECT enabled_count = COUNT_BIG(*) FROM config.collection_schedule WHERE enabled = 1;
-- expected: 34/34

EXEC config.apply_collection_preset @preset_name = N'Garbage';
-- expected: RAISERROR "Invalid preset name "Garbage". Valid presets: Off, Aggressive, Balanced, Low-Impact"
```

Verified against sql2022 — all three transitions produce the expected counts and invalid preset raises cleanly.

  • Built clean (no code changes outside of SQL + docs)
  • Applied to sql2022; Off → 0 enabled, Balanced → 34 enabled
  • Invalid preset raises with updated error text
  • Reviewer sanity check on sql2016/sql2019/sql2022 (should be identical behavior; the proc is ANSI SQL + static UPDATE)

Heads up

Applying a non-Off preset overrides any manual UPDATE config.collection_schedule SET enabled = 0 on a specific collector. That's intentional — per-collector disable/re-enable is the user's choice to make after switching presets. Documented in the proc header.

No upgrade script needed — `install/41_schedule_management.sql` uses the stub-then-`ALTER` pattern and re-runs on upgrade.

Closes #888.

🤖 Generated with Claude Code

#888)

config.apply_collection_preset now accepts a fourth preset, Off, which
sets enabled = 0 across every row in config.collection_schedule without
touching frequencies. The three existing presets (Aggressive, Balanced,
Low-Impact) now also set enabled = 1 on every row before applying their
frequencies, so switching back from Off reliably resumes collection —
including daily/on-load collectors not in the preset list.

Pair with two SQL Agent jobs to compose time-of-day windows (apply
Off at the start of a quiet window, apply a named preset to resume)
without needing a scheduler feature in the collectors themselves.

Heads up: applying a non-Off preset overrides any manual
UPDATE config.collection_schedule SET enabled = 0 on a specific
collector. Documented in the proc header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 6c01da9 into dev Apr 24, 2026
7 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/888-off-preset branch April 24, 2026 14:45
pull Bot pushed a commit to ehtick/PerformanceMonitor that referenced this pull request Apr 29, 2026
…ll, version bumps

- New Installed Version column in Manage Servers for both editions:
  * Full: probes config.installation_history per server in parallel
  * Lite: shows the running app version (mirrors Full's header for consistency)
- Back-ports the Ellipse-with-DataTriggers status dot and right-aligned
  favorite star from Lite's server list to the Full Dashboard
- Bumps Version/AssemblyVersion/FileVersion/InformationalVersion to 2.9.0
  in Dashboard, Lite, Installer, and Installer.Core
- Rewrites CHANGELOG: fixes the 2.8.0 date to 2026-04-22 (was TBD), moves
  Off preset (erikdarlingdata#888) to 2.9.0 since erikdarlingdata#891 landed after the v2.8.0 tag, and
  adds the full 2.9.0 entry covering the post-2.8.0 PR set
- Updates README's DuckDB version reference (1.5.0 -> 1.5.2)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant