Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 07f22d0

Browse files
committed
Implementing perf tests for foreign key constraints.
The same dataset is tested in three different configurations, 1) No foreign key constraints 2) Immediate foreign key constraints 3) Deferrable foreign key constraints. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=97788835
1 parent 2174631 commit 07f22d0

File tree

2 files changed

+400
-0
lines changed

2 files changed

+400
-0
lines changed

perf/lf_perf_test.js

+26
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ goog.setTestOnly();
1818
goog.require('goog.Promise');
1919
goog.require('goog.testing.AsyncTestCase');
2020
goog.require('goog.testing.jsunit');
21+
goog.require('lf.ConstraintTiming');
2122
goog.require('lf.schema.DataStoreType');
2223
goog.require('lf.testing.Capability');
2324
goog.require('lf.testing.perf.BenchmarkRunner');
25+
goog.require('lf.testing.perf.ForeignKeysBenchmark');
2426
goog.require('lf.testing.perf.FullTableBenchmark');
2527
goog.require('lf.testing.perf.LoadingEmptyDbBenchmark');
2628
goog.require('lf.testing.perf.LoadingPopulatedDbBenchmark');
@@ -270,3 +272,27 @@ function test6ScenarioSimulations() {
270272
}, fail);
271273
}, fail);
272274
}
275+
276+
277+
function test7ForeignKeys() {
278+
asyncTestCase.waitForAsync('test7ForeignKeys');
279+
280+
goog.Promise.all([
281+
lf.testing.perf.ForeignKeysBenchmark.create(
282+
lf.ConstraintTiming.IMMEDIATE),
283+
lf.testing.perf.ForeignKeysBenchmark.create(
284+
lf.ConstraintTiming.DEFERRABLE),
285+
lf.testing.perf.ForeignKeysBenchmark.create(null)
286+
]).then(function(benchmarks) {
287+
var benchmarkRunner = new lf.testing.perf.BenchmarkRunner(
288+
'ForeignKeysBenchmark');
289+
benchmarks.forEach(function(benchmark) {
290+
benchmarkRunner.schedule(benchmark);
291+
});
292+
293+
return benchmarkRunner.run(REPETITIONS);
294+
}).then(function(results) {
295+
overallResults.push(results);
296+
asyncTestCase.continueTesting();
297+
}, fail);
298+
}

0 commit comments

Comments
 (0)