import type { ProcessMetrics, Process } from '@core/types'; import Badge from '../shared/Badge'; interface MetricsTableProps { metrics: ProcessMetrics[]; processMap: Record; } function boundVariant(type: ProcessMetrics['boundType']) { if (type === 'CPU Bound') return 'cpu'; if (type === 'I/O Bound') return 'io'; return 'balanced'; } const MetricsTable = ({ metrics, processMap }: MetricsTableProps) => { if (metrics.length === 0) { return (
Nenhum processo concluĂ­do ainda.
); } return (
{metrics.map((m, i) => { const proc = processMap[m.processId]; const name = proc?.name ?? m.processId; const color = proc?.color ?? '#94a3b8'; return ( ); })}
Processo Arrival Start Finish Response Turnaround Waiting CPU Time I/O Time CPU% Bound
{proc?.pid !== undefined && ( #{proc.pid} )} {name}
{m.arrivalTime} {m.startTick} {m.finishTick} {m.responseTime} {m.turnaroundTime} {m.waitingTime} {m.cpuTime} {m.ioTime} {m.cpuUtilization.toFixed(1)}% {m.boundType}
); }; export default MetricsTable;