Skip to content

feat(backend): API & Database Scaling Part 49 / Advanced Logic Part 39 (#294)#850

Merged
Wilfred007 merged 5 commits into
Gildado:mainfrom
drips-projects:API-Database-Scaling-Part-49
May 30, 2026
Merged

feat(backend): API & Database Scaling Part 49 / Advanced Logic Part 39 (#294)#850
Wilfred007 merged 5 commits into
Gildado:mainfrom
drips-projects:API-Database-Scaling-Part-49

Conversation

@Joeloo1
Copy link
Copy Markdown
Contributor

@Joeloo1 Joeloo1 commented May 29, 2026

Summary

  • GET /api/v1/db-scaling/table-io-stats — per-table I/O snapshot from pg_statio_user_tables covering heap, index, and TOAST block reads vs buffer-cache hits, with a computed heapCacheHitRatio to surface cache-cold tables
  • GET /api/v1/db-scaling/index-usage-stats — per-index access snapshot from pg_stat_user_indexes showing scan count, rows read, and rows fetched; ordered by scan frequency to identify hot and unused indexes
  • Both endpoints accept ?limit query param (default 30, max 100)

Acceptance Criteria

  • API endpoints are functional and tested
  • Proper error responses: 400 on invalid limit, 500 via next(err) on service failure
  • No schema changes — both endpoints query built-in PostgreSQL system views; no migration required
  • Integration tests: happy path, invalid-limit 400, and service-throws 500 for each endpoint (6 tests total)

Closes #739

Joeloo1 and others added 3 commits May 29, 2026 22:02
- GET /api/v1/db-scaling/bgwriter-stats — pg_stat_bgwriter snapshot
  (checkpoint frequency, buffer write counts, I/O durations)
- GET /api/v1/db-scaling/database-stats — pg_stat_database snapshot
  (txn throughput, cache hit ratio, deadlocks, temp file usage)
- Add WebhookService with retry/backoff delivery and delivery log writes
- Integration tests for both new db-scaling endpoints
- OpenAPI spec updated
Gildado#294)

- GET /api/v1/db-scaling/table-io-stats — pg_statio_user_tables snapshot
  (heap, index, TOAST block reads vs hits; heapCacheHitRatio computed)
- GET /api/v1/db-scaling/index-usage-stats — pg_stat_user_indexes snapshot
  (idx_scan, idx_tup_read, idx_tup_fetch per index; ordered by scan count)
- Both endpoints accept ?limit (default 30, max 100) with 400 validation
- Integration tests: happy path, invalid-limit 400, service-throws 500
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Joeloo1 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

Joeloo1 added 2 commits May 29, 2026 23:36
- Remove unused imports: StellarWalletsKit, MapPin, screen, AxiosError
- Remove unused eslint-disable directive in transactionHistoryApi test
- Fix catch binding: catch (err) → catch in PayrollScheduleForm
- Fix no-misused-promises: wrap async onSubmit in void handler
- Fix prefer-const: let current → const in SchedulePreview
- Remove unused xdr/nativeToScVal destructuring in useContractMetrics
- Fix no-base-to-string: guard String(val) for object types
- Remove unused SchedulingWizard import and handleScheduleComplete in PayrollScheduler
- Fix JSX parse error: </main> → </div> in Settings
- Remove dead useTheme/languageLoading code in Settings
- Replace unsafe (error as any) casts with proper instanceof checks
@Wilfred007 Wilfred007 merged commit a900a1d into Gildado:main May 30, 2026
1 check failed
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.

[BACKEND] Issue #294 - API & Database Scaling Part 49

2 participants