Skip to content

Commit

Permalink
add FPS Table
Browse files Browse the repository at this point in the history
  • Loading branch information
BoringBoredom committed Mar 5, 2024
1 parent c7b7f69 commit 322afab
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 76 deletions.
167 changes: 100 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 48 additions & 2 deletions src/components/DataDisplay/DataDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,51 @@ function BoxFps({ data }: { data: Data }) {
);
}

function TableFps({ data }: { data: Data }) {
return (
<Table>
<Table.Thead>
<Table.Tr>
<Table.Th>Name</Table.Th>
<Table.Th>Max</Table.Th>
<Table.Th>Avg</Table.Th>
<Table.Th>Min</Table.Th>
<Table.Th>1 %ile</Table.Th>
<Table.Th>0.1 %ile</Table.Th>
<Table.Th>0.01 %ile</Table.Th>
<Table.Th>1% Low</Table.Th>
<Table.Th>0.1% Low</Table.Th>
<Table.Th>0.01% Low</Table.Th>
<Table.Th>STDEV</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>
{data.benches.map((bench) => (
<Table.Tr
key={bench.name + bench.uploaded}
className={s.text}
style={{ backgroundColor: bench.color }}
>
<Table.Td>{bench.name}</Table.Td>
<Table.Td>{bench.fps.metrics.max.toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.avg.toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.min.toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.percentiles[1].toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.percentiles[0.1].toFixed(2)}</Table.Td>
<Table.Td>
{bench.fps.metrics.percentiles[0.01].toFixed(2)}
</Table.Td>
<Table.Td>{bench.fps.metrics.lows[1].toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.lows[0.1].toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.lows[0.01].toFixed(2)}</Table.Td>
<Table.Td>{bench.fps.metrics.stdev.toFixed(2)}</Table.Td>
</Table.Tr>
))}
</Table.Tbody>
</Table>
);
}

function BarFps({ data }: { data: Data }) {
return (
<div style={{ minHeight: `${16 + data.benches.length * 35}vh` }}>
Expand All @@ -609,7 +654,7 @@ function BarFps({ data }: { data: Data }) {
].toFixed(2);
}

if (metric.name.includes("% low")) {
if (metric.name.includes("% Low")) {
return bench.fps.metrics.lows[
parseFloat(metric.name.split(" ")[0])
].toFixed(2);
Expand Down Expand Up @@ -685,7 +730,8 @@ export default function DataDisplay({
{chartTypes[5].show && <PercentilesFps data={data} />}
{chartTypes[6].show && <LowsFps data={data} />}
{chartTypes[7].show && <BoxFps data={data} />}
{chartTypes[8].show && <BarFps data={data} />}
{chartTypes[8].show && <TableFps data={data} />}
{chartTypes[9].show && <BarFps data={data} />}
</SimpleGrid>
</Stack>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export async function handleUpload(
b.fps.metrics.percentiles[percentile] -
a.fps.metrics.percentiles[percentile]
);
} else if (sortBy.includes("% low")) {
} else if (sortBy.includes("% Low")) {
const low = parseFloat(sortBy.split(" ")[0]);

sortedBenches.sort(
Expand Down
Loading

0 comments on commit 322afab

Please sign in to comment.