Skip to content

Commit

Permalink
use timestamp and name as identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
BoringBoredom committed Feb 28, 2024
1 parent 4494bc4 commit a59d04f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 49 deletions.
57 changes: 8 additions & 49 deletions src/components/DataDisplay/DataDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ function Info({ data, colors }: { data: Data; colors: typeof initialColors }) {
<Table.Tbody>
{data.benches.map((bench, index) => (
<Table.Tr
key={
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max
}
key={bench.name + bench.uploaded}
className={s.text}
style={{ backgroundColor: colors[index] }}
>
Expand Down Expand Up @@ -137,12 +131,7 @@ function LineMs({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: bench.ms.chartFormat,
backgroundColor: colors[index],
Expand Down Expand Up @@ -219,12 +208,7 @@ function LineFps({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: bench.fps.chartFormat,
backgroundColor: colors[index],
Expand Down Expand Up @@ -301,12 +285,7 @@ function ScatterMs({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: bench.ms.chartFormat,
backgroundColor: colors[index],
Expand Down Expand Up @@ -377,12 +356,7 @@ function ScatterFps({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: bench.fps.chartFormat,
backgroundColor: colors[index],
Expand Down Expand Up @@ -453,12 +427,7 @@ function PercentilesFps({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: percentileList.map((percentile) => ({
x: percentile,
Expand Down Expand Up @@ -533,12 +502,7 @@ function LowsFps({
datasetIdKey="datasetIdKey"
data={{
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: percentileList.map((percentile) => ({
x: percentile,
Expand Down Expand Up @@ -627,12 +591,7 @@ function BoxFps({
],
],
datasets: data.benches.map((bench, index) => ({
datasetIdKey:
bench.name +
bench.fps.metrics.avg +
bench.fps.metrics.stdev +
bench.fps.metrics.min +
bench.fps.metrics.max,
datasetIdKey: bench.name + bench.uploaded,
label: bench.name,
data: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/components/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function processCfxJson(name: string, bench: Cfx): Bench {

return {
name,
uploaded: Date.now().toString(),
duration,
frames: unsortedMs.length,
...(dropped.length !== 0 && {
Expand Down Expand Up @@ -212,6 +213,7 @@ function processCsv(

return {
name,
uploaded: Date.now().toString(),
duration,
frames: unsortedMs.length,
...(droppedIndex !== -1 && { dropped }),
Expand Down
1 change: 1 addition & 0 deletions src/components/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface Bench {
name: string;
uploaded: string;
duration: number;
frames: number;
dropped?: number;
Expand Down

0 comments on commit a59d04f

Please sign in to comment.