Skip to content

feat(backend): API & Database Scaling Parts 37, 38, 42 & 50 (#727, #728, #732, #740)#848

Merged
Wilfred007 merged 10 commits into
Gildado:mainfrom
0x860:fix/scaling-parts-37-38-42-50
May 29, 2026
Merged

feat(backend): API & Database Scaling Parts 37, 38, 42 & 50 (#727, #728, #732, #740)#848
Wilfred007 merged 10 commits into
Gildado:mainfrom
0x860:fix/scaling-parts-37-38-42-50

Conversation

@0x860

@0x860 0x860 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements eight new DB scaling diagnostic endpoints continuing the PostgreSQL observability series in dbScalingService, dbScalingController, and dbScalingRoutes.

Part 37 — Issue #282 (#727)

Endpoint Source Purpose
GET /api/v1/db-scaling/connection-breakdown pg_stat_activity Connections grouped by state and application name
GET /api/v1/db-scaling/db-settings pg_settings Curated scaling-relevant configuration parameters

Part 38 — Issue #283 (#728)

Endpoint Source Purpose
GET /api/v1/db-scaling/seq-scan-stats?limit=20 pg_stat_user_tables Tables with high sequential scan ratios
GET /api/v1/db-scaling/wal-stats pg_stat_wal Cumulative WAL generation statistics

Part 42 — Issue #287 (#732)

Endpoint Source Purpose
GET /api/v1/db-scaling/bgwriter-stats pg_stat_bgwriter Checkpoint and buffer write metrics
GET /api/v1/db-scaling/temp-file-usage pg_stat_database Temporary file spill usage for current database

Part 50 — Issue #295 (#740)

Endpoint Source Purpose
GET /api/v1/db-scaling/database-stats pg_stat_database Transaction counts, cache hit ratio, deadlocks
GET /api/v1/db-scaling/block-io-stats pg_stat_database Block I/O and session timing statistics

All endpoints follow existing auth, error handling, logging, and Swagger annotation conventions. Integration tests added in dbScalingRoutes.test.ts.

Verification

  • All eight endpoints wired through service → controller → route layers
  • Query parameter validation on seq-scan-stats (limit, max 100)
  • bigint values wrapped with Number() for JSON serialisation safety
  • 10 incremental commits with author/committer 0x860 <hello@collinsadi.xyz>
  • Tests not run locally (skipped per project guidance)

Closes #727
Closes #728
Closes #732
Closes #740

Made with Cursor

0x860 and others added 10 commits May 29, 2026 20:22
…nd db settings

Issue Gildado#727 / Gildado#282 — query pg_stat_activity grouped by state and application
name, plus a curated subset of scaling-relevant pg_settings parameters.

Co-authored-by: Cursor <cursoragent@cursor.com>
Issue Gildado#727 / Gildado#282 — expose GET /connection-breakdown and GET /db-settings
with Swagger annotations following existing db-scaling conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
… and db-settings

Issue Gildado#727 / Gildado#282 — five test cases covering success, empty, and error paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
… metrics

Issue Gildado#728 / Gildado#283 — surface tables with high sequential scan ratios and
cumulative WAL generation statistics from pg_stat_wal.

Co-authored-by: Cursor <cursoragent@cursor.com>
Issue Gildado#728 / Gildado#283 — expose GET /seq-scan-stats and GET /wal-stats with
parameter validation and Swagger annotations.

Co-authored-by: Cursor <cursoragent@cursor.com>
…al-stats

Issue Gildado#728 / Gildado#283 — six test cases covering limit validation and error paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
… usage

Issue Gildado#732 / Gildado#287 — query pg_stat_bgwriter for checkpoint/buffer stats and
pg_stat_database for temporary file spill metrics on the current database.

Co-authored-by: Cursor <cursoragent@cursor.com>
Issue Gildado#732 / Gildado#287 — expose GET /bgwriter-stats and GET /temp-file-usage
with Swagger annotations following existing db-scaling conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
…emp-file-usage

Issue Gildado#732 / Gildado#287 — four test cases covering success and error paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lock-io-stats

Issue Gildado#740 / Gildado#295 — four test cases covering database-wide transaction metrics
and block I/O timing endpoints; update test file header for all covered parts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented May 29, 2026

Copy link
Copy Markdown

@0x860 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Wilfred007 Wilfred007 merged commit e72acdd into Gildado:main May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants