You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-11-25 22:32:52 +02:00
adding init to non experiment too #299
This commit is contained in:
@@ -87,17 +87,22 @@ export class Benchmark {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(RUNS: number): Promise<BenchmarkResult[]> {
|
async run(RUNS: number): Promise<BenchmarkResult[]> {
|
||||||
const ret = [await this.runAnExperiment(RUNS)];
|
const ret: BenchmarkResult[] = [];
|
||||||
|
const r = async (): Promise<void> => {
|
||||||
|
if (this.beforeAll) {
|
||||||
|
await this.beforeAll();
|
||||||
|
}
|
||||||
|
ret.push(await this.runAnExperiment(RUNS));
|
||||||
|
if (this.afterAll) {
|
||||||
|
await this.afterAll();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
await r();
|
||||||
for (const exp of Object.values(Experiments)) {
|
for (const exp of Object.values(Experiments)) {
|
||||||
for (const group of Object.values(exp.groups)) {
|
for (const group of Object.values(exp.groups)) {
|
||||||
ActiveExperiments[exp.name] = group;
|
ActiveExperiments[exp.name] = group;
|
||||||
if (this.beforeAll) {
|
await r();
|
||||||
await this.beforeAll();
|
|
||||||
}
|
|
||||||
ret.push(await this.runAnExperiment(RUNS));
|
|
||||||
if (this.afterAll) {
|
|
||||||
await this.afterAll();
|
|
||||||
}
|
|
||||||
ret[ret.length - 1].experiment = exp.name + '=' + group;
|
ret[ret.length - 1].experiment = exp.name + '=' + group;
|
||||||
}
|
}
|
||||||
delete ActiveExperiments[exp.name];
|
delete ActiveExperiments[exp.name];
|
||||||
|
|||||||
Reference in New Issue
Block a user