Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce integration benchmarks #2381

Merged
merged 46 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2d7e786
Update docker.md
noisersup Apr 5, 2023
4efda56
Merge remote-tracking branch 'upstream/main' into update-compose-docs
noisersup Apr 5, 2023
643efbd
Move restart field
noisersup Apr 5, 2023
be68ecb
Change default log-level in docs
noisersup Apr 5, 2023
72d1ace
wip
noisersup Apr 5, 2023
15320ff
wip (still dirty)
noisersup Apr 6, 2023
d15a10c
Merge branch 'main' into benchmarks
noisersup Apr 6, 2023
8955cbc
generate data
noisersup Apr 6, 2023
f007475
dataset improvements
noisersup Apr 6, 2023
9a2a5da
remove setup PushdownDisabled options
noisersup Apr 6, 2023
471c606
wip
noisersup Apr 6, 2023
d0cf8a3
remove old test
noisersup Apr 6, 2023
8164b35
refactor
noisersup Apr 6, 2023
6d5b0fd
wip
noisersup Apr 6, 2023
8d59849
add task for benchmarks
noisersup Apr 6, 2023
50256f3
fix
noisersup Apr 6, 2023
2c1b8d9
wip
noisersup Apr 7, 2023
b3a04d0
wip
noisersup Apr 7, 2023
1f8bd16
wip
noisersup Apr 11, 2023
1f6659f
Merge branch 'main' into benchmarks
noisersup Apr 11, 2023
0bfb2e1
wip
noisersup Apr 11, 2023
d8b0add
wip
noisersup Apr 11, 2023
477058f
wip
noisersup Apr 11, 2023
bd26a61
update taskfile
noisersup Apr 11, 2023
e2fa2ab
remove stale code
noisersup Apr 12, 2023
095f8a6
cleanup
noisersup Apr 12, 2023
6bcaff6
wip
noisersup Apr 12, 2023
2dda839
wip
noisersup Apr 12, 2023
2a32885
wip
noisersup Apr 12, 2023
e4c280f
wip
noisersup Apr 12, 2023
d840fc6
wip
noisersup Apr 12, 2023
347ec8a
Merge branch 'main' into benchmarks
noisersup Apr 12, 2023
13e7d03
replace panic
noisersup Apr 13, 2023
dd35578
add more comments
noisersup Apr 13, 2023
5f6a441
update generator
noisersup Apr 14, 2023
caf3039
Apply suggestions
noisersup Apr 17, 2023
aba7104
wip
noisersup Apr 17, 2023
8274f89
wip
noisersup Apr 17, 2023
64847ea
wip
noisersup Apr 17, 2023
48a6450
wip
noisersup Apr 17, 2023
40a1b1f
Merge branch 'main' into benchmarks
Apr 18, 2023
b987364
wip
noisersup Apr 18, 2023
9a8c621
Update integration/setup/setup.go
noisersup Apr 18, 2023
fe16d54
wip
noisersup Apr 18, 2023
64f809f
Update integration/shareddata/iterator.go
noisersup Apr 18, 2023
5e3e34e
Merge branch 'main' into benchmarks
AlekSi Apr 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip (still dirty)
  • Loading branch information
noisersup committed Apr 6, 2023
commit 15320ff0958f6e5f5d03c2cad1cc0401b63a9597
2 changes: 1 addition & 1 deletion integration/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type QueryBenchmarkCase struct {
}

func BenchmarkFoo(b *testing.B) {
ctx, coll, collNoPushdown := setup.SetupBenchmark(b)
ctx, coll, collNoPushdown, _ := setup.SetupBenchmark(b)

for name, bm := range map[string]QueryBenchmarkCase{
"String": {
Expand Down
30 changes: 21 additions & 9 deletions integration/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,39 @@ func SetupWithOpts(tb testing.TB, opts *SetupOpts) *SetupResult {
}
}

func SetupBenchmark(tb testing.TB) (context.Context, *mongo.Collection, *mongo.Collection) {
func SetupBenchmark(tb testing.TB) (context.Context, *mongo.Collection, *mongo.Collection, *mongo.Collection) {
tb.Helper()

if *compatURLF == "" {
tb.Skip("-compat-url is empty, skipping benchmark")
}

// TODO insert data

ctx, cancel := context.WithCancel(testutil.Ctx(tb))

target := SetupWithOpts(tb, &SetupOpts{
Providers: []shareddata.Provider{shareddata.Scalars},
})
level := zap.NewAtomicLevelAt(zap.ErrorLevel)
if *debugSetupF {
level = zap.NewAtomicLevelAt(zap.DebugLevel)
}
logger := testutil.Logger(tb, level)

targetNoPushdown := SetupWithOpts(tb, &SetupOpts{
Providers: []shareddata.Provider{shareddata.Scalars},
DisablePushdown: true,
})
targetClient, _ := setupListener(tb, ctx, logger)
targetNoPushdownClient, _ := setupListener(tb, ctx, logger, listenerPushdownDisabled)

compatClient := setupClient(tb, ctx, *compatURLF)

// TODO "compat" collection

tb.Cleanup(cancel)

return ctx, target.Collection, targetNoPushdown.Collection
dbName := tb.Name()
collName := "Benchmark"

return ctx,
targetClient.Database(dbName).Collection(collName),
targetNoPushdownClient.Database(dbName).Collection(collName),
compatClient.Database(dbName).Collection(collName)
}

// Setup setups a single collection for all compatible providers, if the are present.
Expand Down