Functions

f
compute(
groups: string[][],
weights: Map<string, number>,
wallTimes: Map<number, number>
): Map<string, number>

Distributes each group's wall-clock ms to its files proportionally by LPT weight.

f
persist(
fileTimes: Map<string, number>,
projectRoot: string
): Promise<void>

Writes the merged per-file timings back to tmp/test-timings.json for the next run to pack with.

f
print(
fileTimes: Map<string, number>,
projectRoot: string
): void

--debug listing of this run's per-file wall times, slowest first.

f
read(projectRoot: string): Task<Record<string, number>, never>

Reads tmp/test-timings.json from projectRoot; returns {} on any error or invalid content.

Usage

import * as mod from "lib/commands/test/timings.ts";