File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function benchRunCommand(): void
43
43
* @see https://github.com/mongodb/specifications/blob/ddfc8b583d49aaf8c4c19fa01255afb66b36b92e/source/benchmarking/benchmarking.rst#find-one-by-id
44
44
* @param array{options: array} $params
45
45
*/
46
- #[BeforeMethods('setupFindOneById ' )]
46
+ #[BeforeMethods('beforeFindOneById ' )]
47
47
#[ParamProviders('provideFindOneByIdParams ' )]
48
48
#[Revs(1 )]
49
49
public function benchFindOneById (array $ params ): void
@@ -55,7 +55,7 @@ public function benchFindOneById(array $params): void
55
55
}
56
56
}
57
57
58
- public function setupFindOneById (): void
58
+ public function beforeFindOneById (): void
59
59
{
60
60
$ tweet = Data::readJsonFile (Data::TWEET_FILE_PATH );
61
61
$ docs = array_map (fn ($ id ) => $ tweet + ['_id ' => $ id ], range (1 , 10_000 ));
@@ -85,7 +85,7 @@ public function benchInsertOne(array $params): void
85
85
$ collection = Utils::getCollection ();
86
86
87
87
for ($ i = $ params ['repeat ' ]; $ i > 0 ; $ i --) {
88
- $ collection ->insertOne ($ params ['document ' ], $ params [ ' options ' ] ?? [] );
88
+ $ collection ->insertOne ($ params ['document ' ]);
89
89
}
90
90
}
91
91
Original file line number Diff line number Diff line change @@ -26,13 +26,12 @@ public function isApplicable(): bool
26
26
27
27
public function getInformation (): Information
28
28
{
29
- $ client = Utils::getClient ();
30
- $ client ->getManager ()->selectServer ();
29
+ $ manager = Utils::getClient ()->getManager ();
31
30
32
31
return new Information ('mongodb ' , array_merge (
33
32
$ this ->getUri (),
34
- $ this ->getServerInfo ($ client -> getManager () ),
35
- $ this ->getBuildInfo ($ client -> getManager () ),
33
+ $ this ->getServerInfo ($ manager ),
34
+ $ this ->getBuildInfo ($ manager ),
36
35
));
37
36
}
38
37
You can’t perform that action at this time.
0 commit comments