Files
supabase/apps/studio/components/interfaces/QueryInsights/QueryInsightsChart/QueryInsightsChart.constants.ts
T
7ed8ab83a8 feat(studio): query insights improvements (#43109)
## 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>
2026-03-13 15:09:26 +00:00

23 lines
872 B
TypeScript

import { CHART_COLORS } from 'components/ui/Charts/Charts.constants'
export const CHART_TABS = [
{ id: 'query_latency', label: 'Query latency' },
{ id: 'rows_read', label: 'Rows read' },
{ id: 'calls', label: 'Calls' },
{ id: 'cache_hits', label: 'Cache hits' },
]
export const LEGEND_ITEMS: Record<string, { label: string; color: string; dataKey: string }[]> = {
query_latency: [
{ label: 'P50', color: 'hsl(var(--chart-4))', dataKey: 'p50' },
{ label: 'P95', color: CHART_COLORS.GREEN_1, dataKey: 'p95' },
],
rows_read: [{ label: 'Rows Read', color: CHART_COLORS.GREEN_1, dataKey: 'rows_read' }],
calls: [{ label: 'Calls', color: CHART_COLORS.GREEN_1, dataKey: 'calls' }],
cache_hits: [{ label: 'Cache Hits', color: '#10B981', dataKey: 'cache_hits' }],
}
export const CHART_TYPE = 'linear'
export const SEL_COLOR = 'hsl(var(--chart-blue))'