From 235ae718ec6fa8c0e69aee0627340f1eabf4671a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 1 Apr 2026 03:47:54 +1300 Subject: [PATCH] (feat): add schema, explain, tuning, and index monitoring tabs --- .../monitoring/+page.svelte | 464 +++++++++++++++++- 1 file changed, 450 insertions(+), 14 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/monitoring/+page.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/monitoring/+page.svelte index aeb6faad7..d33138234 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/monitoring/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/monitoring/+page.svelte @@ -1,6 +1,6 @@ {#if !database} @@ -193,7 +359,6 @@ {:else} - @@ -221,18 +386,49 @@ active={activeSection === 'auditLogs'}> Audit Logs + (activeSection = 'schema')} + active={activeSection === 'schema'}> + Schema + + (activeSection = 'schemaPreview')} + active={activeSection === 'schemaPreview'}> + Schema Preview + + (activeSection = 'explain')} + active={activeSection === 'explain'}> + Explain + + (activeSection = 'tuning')} + active={activeSection === 'tuning'}> + Tuning + + (activeSection = 'indexes')} + active={activeSection === 'indexes'}> + Indexes + - + {#if activeSection === 'metrics' || activeSection === 'slowQueries' || activeSection === 'insights' || activeSection === 'auditLogs'} + + {/if} {#if activeSection === 'metrics'} - {:else if metrics} - Resource Utilization CPU, memory, and storage usage for the selected period. @@ -320,7 +515,6 @@ - Database Activity Connection count, IOPS, and queries per second. @@ -449,7 +643,6 @@ {/each} {:else if performanceInsights} - Query Summary Aggregated query performance statistics. @@ -489,7 +682,6 @@ - {#if performanceInsights.topQueries.length > 0} @@ -533,7 +725,6 @@ {/if} - {#if performanceInsights.waitEvents.length > 0} @@ -633,6 +824,251 @@ {/if} {/if} + + + {#if activeSection === 'schema'} + + + + Current database schema (tables, columns, types, constraints, and + indexes). + + + + + {#if isLoadingSchema} + + {#each Array(5) as _} + + {/each} + + {:else if schema} + + {:else} + + Schema data is not available for this database. + + {/if} + + {/if} + + + {#if activeSection === 'schemaPreview'} + + + Preview the impact of a SQL schema change without applying it. + + + + This performs a dry-run analysis only. No changes will be applied to your + database. + + + + + + + {#if previewResult} + + {/if} + + + {#if previewResult} + + {/if} + + {/if} + + + {#if activeSection === 'explain'} + + + Run EXPLAIN on a SQL query to view its execution plan. + + + + + + + {#if explainAnalyze} + + EXPLAIN ANALYZE will execute the query against your database. Use + with caution on write operations. + + {/if} + + + + + {#if explainResult} + + {/if} + + + {#if explainResult} + + {/if} + + {/if} + + + {#if activeSection === 'tuning'} + + + + Configuration tuning recommendations based on workload analysis. + + + + + {#if isLoadingTuning} + + {#each Array(4) as _} + + {/each} + + {:else if tuningResult} + {@const entries = renderEntries(tuningResult)} + {#if entries.length === 0} + + No tuning recommendations at this time. Your configuration looks + good. + + {:else} + + + Parameter + Recommendation + + {#each entries as entry, i} + + + {entry.key} + + + {entry.value} + + + {/each} + + {/if} + {:else} + + Tuning recommendations are not available. Ensure the database has been + active with sufficient workload data. + + {/if} + + {/if} + + + {#if activeSection === 'indexes'} + + + + Index suggestions based on query patterns and table statistics. + + + + + {#if isLoadingIndexSuggestions} + + {#each Array(3) as _} + + {/each} + + {:else if indexSuggestions} + {@const entries = renderEntries(indexSuggestions)} + {#if entries.length === 0} + + No index suggestions at this time. Your indexes appear to be + well-optimized. + + {:else} + + {/if} + {:else} + + Index suggestions are not available. Ensure the database has been active + with sufficient query history. + + {/if} + + {/if} {/if}