chore(vendor): import pi 0.85.1
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: d981de1229ef899957bbe968bc8dcda02a21f477
This commit is contained in:
35
third_party/pi/packages/agent/benchmark/session/storage.bench.ts
vendored
Normal file
35
third_party/pi/packages/agent/benchmark/session/storage.bench.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import {
|
||||
STORAGE_BENCHMARK_DATASETS,
|
||||
STORAGE_READ_BENCHMARK_SCENARIOS,
|
||||
STORAGE_WRITE_BENCHMARK_SCENARIOS,
|
||||
seedStorageBenchmark,
|
||||
} from "../../src/harness/session/testing/index.ts";
|
||||
import { registerReadBenchmarks, registerWriteBenchmarks } from "./benchmark.ts";
|
||||
import { storageBenchmarkTargets } from "./storage-targets.ts";
|
||||
|
||||
await registerReadBenchmarks({
|
||||
datasets: STORAGE_BENCHMARK_DATASETS,
|
||||
targets: storageBenchmarkTargets,
|
||||
scenarios: STORAGE_READ_BENCHMARK_SCENARIOS,
|
||||
prepare(fixture, dataset) {
|
||||
return seedStorageBenchmark(fixture.storage, dataset);
|
||||
},
|
||||
getSubject(fixture) {
|
||||
return fixture.storage;
|
||||
},
|
||||
});
|
||||
|
||||
await registerWriteBenchmarks({
|
||||
targets: storageBenchmarkTargets,
|
||||
scenarios: STORAGE_WRITE_BENCHMARK_SCENARIOS,
|
||||
async prepare(fixture, scenario) {
|
||||
await scenario.prepare?.(fixture.storage);
|
||||
return fixture.storage;
|
||||
},
|
||||
expectedResult(scenario) {
|
||||
return scenario.writeCount;
|
||||
},
|
||||
run(storage, scenario) {
|
||||
return scenario.run(storage);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user