import { Fragment } from 'react' import { ReportWidgetProps, ReportWidgetRendererProps } from '../ReportWidget' import { TextFormatter } from '@/components/interfaces/Settings/Logs/LogsFormatters' import Table from '@/components/to-be-cleaned/Table' import StackedBarChart from '@/components/ui/Charts/StackedBarChart' export const CacheHitRateChartRenderer = ( props: ReportWidgetProps<{ timestamp: string hit_count: number miss_count: number }> ) => { const stackedData = props.data.flatMap((datum) => [ { timestamp: +datum.timestamp / 1000, count: datum.hit_count, type: 'hit', }, { timestamp: +datum.timestamp / 1000, count: datum.miss_count, type: 'miss', }, ]) return ( ) } export const TopCacheMissesRenderer = ( props: ReportWidgetRendererProps<{ path: string search: string count: number }> ) => { if (props.data.length === 0) return null const headerClasses = 'text-xs! py-2! p-0 font-bold bg-surface-200!' const cellClasses = 'text-xs! py-2!' return ( <>

Top Cache Misses

RequestCount } body={ <> {props.data.map((datum) => (
{datum.count}
))} } /> ) }