Skip to content

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benpoulson committed Apr 25, 2024
1 parent 4a96721 commit b526c98
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 11 deletions.
1 change: 0 additions & 1 deletion frontend/src/Pages/ListTraces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default function ListTraces() {
chartData: chartData,
}));

console.log(chartData);
});
}

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/Pages/SingleTrace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export default function SingleTrace() {
return null;
}

console.log(value);

return [
method ? clazz : null,
method,
Expand Down
62 changes: 52 additions & 10 deletions frontend/src/Pages/TraceSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,25 @@ export default function TraceSymbol() {
const tableRowsCallRows = Object.entries(response.trace.perfdata).map(([key, value]) => {
let [caller, destination] = key.split(/==>|>>>/);


let typedValue: {ct: number, wt: number, cpu: number, mu: number, pmu: number} = value as any;
// We're not interested in this row
if (caller !== symbolName) {
return null;
}

console.log(key, value);
return [
key,
"0",
"0",
Math.trunc(value.wt / 1000).toLocaleString() + "ms",
"0ms",
"0%"
typedValue.ct.toLocaleString(),
Math.trunc(typedValue.wt / 1000).toLocaleString() + "ms",
];
}).filter((row) => row !== null);
setTableRowsCalls(tableRowsCallRows);

})
}, [state.id, state.search])

const tableColumns: MUIDataTableColumn[] = [
const tableColumnsLeft: MUIDataTableColumn[] = [
{
name: "symbol",
label: "Symbol",
Expand Down Expand Up @@ -161,6 +159,50 @@ export default function TraceSymbol() {
},
];

const tableColumnsRight: MUIDataTableColumn[] = [
{
name: "symbol",
label: "Symbol",
options: {
filter: false,
sort: true,
customBodyRender: (value: any, tableMeta: any, updateValue: any) => {
let [a, b] = value.split(/==>|>>>/);

if (a && b) {
return <>
<Link href={`/trace/${state.id}/${btoa(b)}`}>{b}</Link>
</>
} else {
return <>
<Link href={`/trace/${state.id}/${btoa(a)}`}>{a}</Link>
</>
}
},
},
},
{
name: "call_count",
label: "Call count",
options: {
hint: "The amount of times this method gets called",
filter: false,
sort: true,
sortCompare: sortNumeric,
}
},
{
name: "wall_time_inclusive",
label: "Wall time (Inclusive)",
options: {
hint: "The amount of time spent in this method AND child methods.",
filter: false,
sort: true,
sortCompare: sortNumeric,
}
},
];


const tableOptions: MUIDataTableOptions = {
filterType: 'checkbox',
Expand Down Expand Up @@ -269,7 +311,7 @@ export default function TraceSymbol() {
<MUIDataTable
title={"Symbols"}
data={tableRowsCalledBy}
columns={tableColumns}
columns={tableColumnsLeft}
options={tableOptions}
/>
</TableContainer>
Expand All @@ -285,8 +327,8 @@ export default function TraceSymbol() {
<MUIDataTable
title={"Symbols"}
data={tableRowsCalls}
columns={tableColumns}
// options={tableOptions}
columns={tableColumnsRight}
options={tableOptions}
/>
</TableContainer>
</Paper>
Expand Down

0 comments on commit b526c98

Please sign in to comment.