ruvector/studio/components/interfaces/QueryPerformance/WithStatements/WithStatements.utils.ts
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

22 lines
810 B
TypeScript

import { QueryPerformanceRow } from '../QueryPerformance.types'
export const transformStatementDataToRows = (data: any[]): QueryPerformanceRow[] => {
if (!data || data.length === 0) return []
const totalTimeAcrossAllQueries = data.reduce((sum, row) => sum + (row.total_time || 0), 0)
return data.map((row) => ({
query: row.query,
rolname: row.rolname || undefined,
calls: row.calls || 0,
mean_time: row.mean_time || 0,
min_time: row.min_time || 0,
max_time: row.max_time || 0,
total_time: row.total_time || 0,
rows_read: row.rows_read || 0,
cache_hit_rate: row.cache_hit_rate || 0,
prop_total_time:
totalTimeAcrossAllQueries > 0 ? (row.total_time / totalTimeAcrossAllQueries) * 100 : 0,
index_advisor_result: row.index_advisor_result || null,
}))
}