fix: improve ClickHouse admin page, fix AgentHealth type error
Rewrite ClickHouse admin to show useful storage metrics instead of often-empty system.events data. Add active queries section. - Replace performance endpoint: query system.parts for disk size, uncompressed size, compression ratio, total rows, part count - Add /queries endpoint querying system.processes for active queries - Frontend: storage overview strip, tables with total size, active queries DataTable - Fix AgentHealth.tsx type: agentId → instanceId in inline type cast Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,11 +21,21 @@ export interface ClickHouseTableInfo {
|
||||
}
|
||||
|
||||
export interface ClickHousePerformance {
|
||||
queryCount: number;
|
||||
insertQueryCount: number;
|
||||
diskSize: string;
|
||||
uncompressedSize: string;
|
||||
compressionRatio: number;
|
||||
totalRows: number;
|
||||
partCount: number;
|
||||
memoryUsage: string;
|
||||
insertedRows: number;
|
||||
currentQueries: number;
|
||||
}
|
||||
|
||||
export interface ClickHouseQuery {
|
||||
queryId: string;
|
||||
elapsedSeconds: number;
|
||||
memory: string;
|
||||
readRows: number;
|
||||
query: string;
|
||||
}
|
||||
|
||||
export interface IndexerPipeline {
|
||||
@@ -67,6 +77,15 @@ export function useClickHousePerformance() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useClickHouseQueries() {
|
||||
const refetchInterval = useRefreshInterval(5_000);
|
||||
return useQuery({
|
||||
queryKey: ['admin', 'clickhouse', 'queries'],
|
||||
queryFn: () => adminFetch<ClickHouseQuery[]>('/clickhouse/queries'),
|
||||
refetchInterval,
|
||||
});
|
||||
}
|
||||
|
||||
export function useIndexerPipeline() {
|
||||
const refetchInterval = useRefreshInterval(10_000);
|
||||
return useQuery({
|
||||
|
||||
Reference in New Issue
Block a user