2024-12-06 12:17:07 +00:00
|
|
|
export type FlameGraphNode = {
|
|
|
|
fn: number;
|
|
|
|
acc: number;
|
|
|
|
parent: number;
|
|
|
|
children: FlameGraphNode[];
|
|
|
|
};
|
|
|
|
|
2024-12-12 10:56:22 +00:00
|
|
|
export async function flameGraphData(): Promise<FlameGraphNode> {
|
|
|
|
return await fetch("/api/flame-graph")
|
|
|
|
.then((v) => v.json())
|
|
|
|
.then((v) => v.flameGraph);
|
2024-12-06 12:17:07 +00:00
|
|
|
}
|
|
|
|
|
2024-12-12 10:56:22 +00:00
|
|
|
export async function codeData(): Promise<string> {
|
|
|
|
return await fetch("/api/source")
|
|
|
|
.then((v) => v.json())
|
|
|
|
.then((v) => v.text);
|
2024-12-06 12:17:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type CodeCovEntry = {
|
|
|
|
index: number;
|
|
|
|
line: number;
|
|
|
|
col: number;
|
|
|
|
covers: number;
|
|
|
|
};
|
|
|
|
|
2024-12-12 10:56:22 +00:00
|
|
|
export async function codeCoverageData(): Promise<CodeCovEntry[]> {
|
|
|
|
return await fetch("/api/code-coverage")
|
|
|
|
.then((v) => v.json())
|
|
|
|
.then((v) => v.codeCoveragea);
|
2024-12-06 12:17:07 +00:00
|
|
|
}
|