File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,12 @@ public function getDriverName()
294
294
return 'mongodb ' ;
295
295
}
296
296
297
+ /** @inheritdoc */
298
+ public function getDriverTitle ()
299
+ {
300
+ return 'MongoDB ' ;
301
+ }
302
+
297
303
/** @inheritdoc */
298
304
protected function getDefaultPostProcessor ()
299
305
{
@@ -320,6 +326,14 @@ public function setDatabase(Database $db)
320
326
$ this ->db = $ db ;
321
327
}
322
328
329
+ /** @inheritdoc */
330
+ public function threadCount ()
331
+ {
332
+ $ status = $ this ->db ->command (['serverStatus ' => 1 ])->toArray ();
333
+
334
+ return $ status [0 ]['connections ' ]['current ' ];
335
+ }
336
+
323
337
/**
324
338
* Dynamically pass methods to the connection.
325
339
*
Original file line number Diff line number Diff line change @@ -305,4 +305,12 @@ public function testServerVersion()
305
305
$ version = DB ::connection ('mongodb ' )->getServerVersion ();
306
306
$ this ->assertIsString ($ version );
307
307
}
308
+
309
+ public function testThreadsCount ()
310
+ {
311
+ $ threads = DB ::connection ('mongodb ' )->threadCount ();
312
+
313
+ $ this ->assertIsInt ($ threads );
314
+ $ this ->assertGreaterThanOrEqual (1 , $ threads );
315
+ }
308
316
}
You can’t perform that action at this time.
0 commit comments