mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +00:00
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>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import React, { useMemo } from 'react'
|
|
|
|
import { Skeleton } from 'ui'
|
|
import { useQueryPerformanceQuery } from '../Reports/Reports.queries'
|
|
|
|
export const QueryPerformanceMetrics = () => {
|
|
const { data: queryMetrics, isLoading } = useQueryPerformanceQuery({
|
|
preset: 'queryMetrics',
|
|
})
|
|
|
|
const stats = useMemo(() => {
|
|
return [
|
|
{
|
|
title: queryMetrics?.[0]?.slow_queries === 1 ? 'Slow Query' : 'Slow Queries',
|
|
value: queryMetrics?.[0]?.slow_queries || '0',
|
|
},
|
|
{
|
|
title: 'Cache Hit Rate',
|
|
value: queryMetrics?.[0]?.cache_hit_rate || '0%',
|
|
},
|
|
{
|
|
title: 'Avg. Rows Per Call',
|
|
value: queryMetrics?.[0]?.avg_rows_per_call || '0',
|
|
},
|
|
]
|
|
}, [queryMetrics])
|
|
|
|
return (
|
|
<section className="px-6 pt-2 pb-4 flex flex-wrap gap-x-6 gap-y-2 w-full">
|
|
{stats.map((card, i) => (
|
|
<React.Fragment key={i}>
|
|
<div className="flex items-baseline gap-2 heading-subSection text-foreground-light">
|
|
{isLoading ? (
|
|
<Skeleton className="h-5 w-24" />
|
|
) : (
|
|
<>
|
|
<span className="text-foreground">{card.value}</span>
|
|
<span>{card.title}</span>
|
|
</>
|
|
)}
|
|
</div>
|
|
{i < stats.length - 1 && <span className="text-foreground-muted">/</span>}
|
|
</React.Fragment>
|
|
))}
|
|
</section>
|
|
)
|
|
}
|