@dapplion/benchmark
Version:
Ensures that new code does not introduce performance regressions with CI. Tracks:
41 lines • 1.39 kB
TypeScript
import { HistoryProviderType, IHistoryProvider } from "./provider.js";
import { Benchmark } from "../types.js";
/**
* Persist results in CSV, one benchmark result per file
*
* ```
* /$dirpath/
* history/
* 52b8122daa9b7a3d0ea0ecfc1ff9eda79a201eb8.csv
* c0203c527c9a2269f1f289fad2c8e25afdc2c169.csv
* latest/
* main.csv
* dev.csv
* ```
*
* ```csv
* id,averageNs,runsDone,totalMs
* sum array with raw for loop,1348118,371,501
* sum array with reduce,16896469,128,2163
* ```
*/
export declare class LocalHistoryProvider implements IHistoryProvider {
private readonly dirpath;
readonly type: HistoryProviderType;
constructor(dirpath: string);
providerInfo(): string;
readLatestInBranch(branch: string): Promise<Benchmark | null>;
writeLatestInBranch(branch: string, benchmark: Benchmark): Promise<void>;
readHistory(): Promise<Benchmark[]>;
readHistoryCommit(commitSha: string): Promise<Benchmark | null>;
writeToHistory(benchmark: Benchmark): Promise<void>;
private readBenchFileIfExists;
/** Read result from CSV + metadata as Embedded Metadata */
private readBenchFile;
/** Write result to CSV + metadata as Embedded Metadata */
private writeBenchFile;
private getLatestInBranchFilepath;
private getHistoryCommitPath;
private getHistoryDirpath;
}
//# sourceMappingURL=local.d.ts.map