mirror of
https://github.com/supabase/supabase.git
synced 2026-06-17 13:14:06 +08:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? This introduces Query Insights. It's the first edition of possible future updates. This takes our old prototype and builds upon it for a more action driven insights view. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Ali Waseem <waseema393@gmail.com>
25 lines
701 B
TypeScript
25 lines
701 B
TypeScript
import type { HealthLevel } from './QueryInsightsHealth.types'
|
|
|
|
export const SLOW_QUERY_THRESHOLD_MS = 200
|
|
export const HIGH_CALL_THRESHOLD = 100
|
|
|
|
export const SCORE_DEDUCTIONS = {
|
|
error: 20,
|
|
indexHighCalls: 15,
|
|
indexLowCalls: 8,
|
|
slowHighCalls: 10,
|
|
slowLowCalls: 5,
|
|
} as const
|
|
|
|
export const HEALTH_LEVELS: Record<HealthLevel, { label: string; min: number }> = {
|
|
healthy: { label: 'Healthy', min: 70 },
|
|
warning: { label: 'Needs attention', min: 40 },
|
|
critical: { label: 'Critical', min: 0 },
|
|
}
|
|
|
|
export const HEALTH_COLORS: Record<HealthLevel, string> = {
|
|
healthy: 'hsl(var(--brand-default))',
|
|
warning: 'hsl(var(--warning-default))',
|
|
critical: 'hsl(var(--destructive-default))',
|
|
}
|