Skip to content

turbostats: the database section, for dbhealth - #443

Merged
turbolytics merged 2 commits into
mainfrom
feat/wire-database-section
Oct 5, 2026
Merged

turbolytics merged 2 commits into
mainfrom
feat/wire-database-section

Conversation

@turbolytics

@turbolytics turbolytics commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Task 1 of the dbhealth v1 plan (turbolytics/dbhealth#1). Implements the section the spec (#441) defines.

  • wire.Database and its sub-types: DatabaseProbe, DatabaseResources, DatabaseConnections, DatabaseMemory, DatabaseTable, DatabaseReplication, DatabaseReplica, DatabaseCollection, DatabaseError.
  • Bundle.Database, optional, beside Pipeline and Serve.
  • bundle.schema.json regenerated (make schema).

Tests: the spec's example round-trips with the spec's field names; a failed probe marshals probe alone; a bundle with only a database section marshals it, and omits it when nil. turbostats/wire and internal/schema pass under -race.

Next: a release, so dbhealth can pin the module.

Second commit. CI's shape guard (TestWire_NoFieldScalesWithCardinality) rejected the section's three lists. They are now bounded in the contract: wire.MaxDatabaseTables 50, MaxDatabaseReplicas 16, MaxDatabaseErrors 60. The widest bundle at those caps is 47,725 bytes, under a 48 KiB ceiling, which means control's 16 KiB body limit has to become 64 KiB for database bundles. That change rides with control's Kind work in a later PR.

wire.Database and its sub-types, as the spec (#441) defines them: probe,
resources, tables, replication and the collection cost. A failed probe
marshals probe alone; the field is optional on the bundle beside
Pipeline and Serve. bundle.schema.json regenerated.

Tests: the spec's example round-trips with the spec's field names; a
failed probe carries no resources, tables or replication; a bundle with
only a database section marshals it and omits it when nil.
…idest bundle

TestWire_NoFieldScalesWithCardinality failed in CI: Database.Tables,
Replication.Replicas and Collection.Errors are slices with no stated
bound. None grows with the data in the database: tables are the
operator's list, replicas are the cluster's topology, errors are one per
table and one per catalog query. The contract now carries the caps,
wire.MaxDatabaseTables 50, MaxDatabaseReplicas 16, MaxDatabaseErrors 60,
and the shape guard exempts the three by name.

TestCollect_AFullDatabaseBundleStaysUnderTheCeiling prices the widest
bundle at those caps: 47725 bytes, under a 48 KiB ceiling. That is three
times the 16 KiB a pipeline bundle's receiver allows, so the receiver that
accepts database bundles needs 64 KiB; that lands with control's kind
change.
@turbolytics
turbolytics merged commit 779c9ba into main Oct 5, 2026
7 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant