mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-09 08:03:50 +00:00
Split the DB health page into independent panes so fast pg_catalog-based diagnostics render without waiting for the slower job table scans, and enrich the slow queries view with server-side sort, reset, and better setup guidance. Backend: - Split /api/db_health into two endpoints: fast panes (database_size, connection_pool, table_maintenance, slow_queries, datatables) and /jobs (job_retention, large_results with scan_limit). - Add GET /api/db_health/slow_queries?sort=total|mean|calls for server-side sorting of pg_stat_statements queries (sort whitelisted via enum, SQL-injection safe). - Add POST /api/db_health/slow_queries/reset to call pg_stat_statements_reset(). - Return stats_reset timestamp from pg_stat_statements_info (PG 14+). - Bump slow queries to top 50 sorted by total_exec_time (was top 10 by mean_exec_time, which misses high-cumulative-load queries). - Truncate slow queries to 500 chars (was 200). - Filter table_maintenance to tables with >= 1000 total tuples. Frontend (DbHealth.svelte): - Two tabs (Overview / Jobs) with auto-refresh on selection. - Refresh buttons right-aligned in both tabs; Jobs tab keeps the scan_limit selector on the left. - Job Retention & Large Results always render, with "Click Refresh to load" placeholders when no data yet. - Slow queries table: clickable column headers for server-side sort, click a row to toggle the full query text. - Reset stats button with confirmation dialog, displays "Stats since" timestamp for before/after comparison workflow. - When pg_stat_statements is not installed, show numbered setup instructions with copyable SQL snippets. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Windmill Backend
This folder holds all backend components, the src/ folder only contains files used to build the "root" binary.
Components
| name | description |
|---|---|
| windmill-api | The API server, exposing functionality to other components and the frontend |
| windmill-audit | Contains audit functionality, allowing different components to record important actions |
| windmill-common | Common code shared by all crates |
| windmill-queue | Contains job & flow queuing functionality, commonly written to by the API server and read from by workers |
| windmill-worker | The worker. Used to process and execute flows & jobs. |
| parsers | Contains code to parse signatures in different langauges. |
Compile sqlx for offline ci
cargo sqlx prepare --workspace -- --bin windmill --features enterprise