1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-29 01:24:36 +02:00

refacotr(gh): refactor

This commit is contained in:
syuilo
2026-07-16 21:11:41 +09:00
parent ab92f98472
commit 64f98faca9
3 changed files with 8 additions and 13 deletions

View File

@@ -234,7 +234,7 @@ async function saveRepresentativeHeadHeapSnapshot(report: BrowserMetricsReport,
await rm(headHeapSnapshotWorkDir, { recursive: true, force: true });
}
async function measureRepo(label: 'base' | 'head', repoDir: string, outputPath: string, heapSnapshotSavePath?: string) {
async function genReport(label: 'base' | 'head', repoDir: string, outputPath: string, heapSnapshotSavePath?: string) {
let server: ReturnType<typeof util.startServer> | null = null;
try {
@@ -269,8 +269,8 @@ async function measureRepo(label: 'base' | 'head', repoDir: string, outputPath:
}
async function main() {
await measureRepo('base', resolve(baseDirArg), resolve(baseOutputArg));
await measureRepo('head', resolve(headDirArg), resolve(headOutputArg), headHeapSnapshotOutputArg == null ? undefined : resolve(headHeapSnapshotOutputArg));
await genReport('base', resolve(baseDirArg), resolve(baseOutputArg));
await genReport('head', resolve(headDirArg), resolve(headOutputArg), resolve(headHeapSnapshotOutputArg));
}
await main();