QueryInsightsTable.constants.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { CircleAlert, Lightbulb } from 'lucide-react'
  2. import type { LucideIcon } from 'lucide-react'
  3. export const ISSUE_DOT_COLORS: Record<
  4. string,
  5. { border: string; background: string; color: string }
  6. > = {
  7. error: {
  8. border: 'border-destructive-500',
  9. background: 'bg-destructive-200',
  10. color: 'text-destructive-600',
  11. },
  12. index: {
  13. border: 'border-warning-500',
  14. background: 'bg-warning-200',
  15. color: 'text-warning-600',
  16. },
  17. slow: {
  18. border: 'border-strong',
  19. background: 'bg-alternative dark:bg-muted',
  20. color: 'text-foreground-lighter',
  21. },
  22. }
  23. export const ISSUE_ICONS: Record<string, LucideIcon> = {
  24. error: CircleAlert,
  25. index: Lightbulb,
  26. slow: CircleAlert,
  27. }
  28. export const QUERY_INSIGHTS_EXPLORER_COLUMNS = [
  29. { id: 'query', name: 'Query', description: undefined, minWidth: 500 },
  30. { id: 'prop_total_time', name: 'Time consumed', description: undefined, minWidth: 150 },
  31. { id: 'calls', name: 'Calls', description: undefined, minWidth: 100 },
  32. { id: 'max_time', name: 'Max time', description: undefined, minWidth: 100 },
  33. { id: 'mean_time', name: 'Mean time', description: undefined, minWidth: 100 },
  34. { id: 'min_time', name: 'Min time', description: undefined, minWidth: 100 },
  35. { id: 'rows_read', name: 'Rows processed', description: undefined, minWidth: 130 },
  36. { id: 'cache_hit_rate', name: 'Cache hit rate', description: undefined, minWidth: 130 },
  37. { id: 'rolname', name: 'Role', description: undefined, minWidth: 200 },
  38. { id: 'application_name', name: 'Source', description: undefined, minWidth: 200 },
  39. ] as const
  40. export const NON_SORTABLE_COLUMNS = [] as const