6
6
use MongoDB \Benchmark \BaseBench ;
7
7
use MongoDB \BSON \Document ;
8
8
use MongoDB \Driver \Command ;
9
- use MongoDB \Driver \WriteConcern ;
10
9
use PhpBench \Attributes \BeforeMethods ;
11
10
use PhpBench \Attributes \ParamProviders ;
12
11
use PhpBench \Attributes \Revs ;
@@ -28,9 +27,10 @@ public function prepareDatabase(): void
28
27
public function benchRunCommand (): void
29
28
{
30
29
$ manager = self ::createClient ()->getManager ();
30
+ $ database = self ::getDatabase ();
31
31
32
32
for ($ i = 0 ; $ i < 10_000 ; $ i ++) {
33
- $ manager ->executeCommand (self :: getDatabase () , new Command (['hello ' => true ]));
33
+ $ manager ->executeCommand ($ database , new Command (['hello ' => true ]));
34
34
}
35
35
}
36
36
@@ -96,12 +96,6 @@ public static function provideInsertOneParams(): Generator
96
96
'repeat ' => 10_000 ,
97
97
];
98
98
99
- yield 'Small doc WC 0 ' => [
100
- 'document ' => self ::readJsonFile (self ::SMALL_FILE_PATH ),
101
- 'repeat ' => 10_000 ,
102
- 'options ' => ['writeConcern ' => new WriteConcern (0 )],
103
- ];
104
-
105
99
yield 'Large doc ' => [
106
100
'document ' => self ::readJsonFile (self ::LARGE_FILE_PATH ),
107
101
'repeat ' => 10 ,
@@ -111,11 +105,5 @@ public static function provideInsertOneParams(): Generator
111
105
'document ' => Document::fromJSON (file_get_contents (self ::LARGE_FILE_PATH )),
112
106
'repeat ' => 10 ,
113
107
];
114
-
115
- yield 'Large doc WC 0 ' => [
116
- 'document ' => Document::fromJSON (file_get_contents (self ::LARGE_FILE_PATH )),
117
- 'repeat ' => 10 ,
118
- 'options ' => ['writeConcern ' => new WriteConcern (0 )],
119
- ];
120
108
}
121
109
}
0 commit comments