diff options
author | msquare <msquare@notrademark.de> | 2019-08-21 15:46:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 15:46:26 +0200 |
commit | 1a6c7599d68cb73f4ce8d1aebec894b10fc7aab1 (patch) | |
tree | fd96fcd0f460a180e2399a7de2174cee86faaf00 /tests/Unit/Controllers/Metrics | |
parent | 4d4fb81cd3dbe276f684feecd03c8fc49c700df0 (diff) | |
parent | efaf29e5ef020694849039713afa0027f92f6bbe (diff) |
Merge pull request #642 from MyIgel/db-stats
Metrics: Add database access time
Diffstat (limited to 'tests/Unit/Controllers/Metrics')
-rw-r--r-- | tests/Unit/Controllers/Metrics/ControllerTest.php | 1 | ||||
-rw-r--r-- | tests/Unit/Controllers/Metrics/StatsTest.php | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/Unit/Controllers/Metrics/ControllerTest.php b/tests/Unit/Controllers/Metrics/ControllerTest.php index f203200c..eefe96ad 100644 --- a/tests/Unit/Controllers/Metrics/ControllerTest.php +++ b/tests/Unit/Controllers/Metrics/ControllerTest.php @@ -54,6 +54,7 @@ class ControllerTest extends TestCase $this->assertArrayHasKey('messages', $data); $this->assertArrayHasKey('password_resets', $data); $this->assertArrayHasKey('registration_enabled', $data); + $this->assertArrayHasKey('database', $data); $this->assertArrayHasKey('sessions', $data); $this->assertArrayHasKey('log_entries', $data); $this->assertArrayHasKey('scrape_duration_seconds', $data); diff --git a/tests/Unit/Controllers/Metrics/StatsTest.php b/tests/Unit/Controllers/Metrics/StatsTest.php index 9ecd4a66..fa78d8c3 100644 --- a/tests/Unit/Controllers/Metrics/StatsTest.php +++ b/tests/Unit/Controllers/Metrics/StatsTest.php @@ -109,6 +109,25 @@ class StatsTest extends TestCase } /** + * @covers \Engelsystem\Controllers\Metrics\Stats::databaseRead + * @covers \Engelsystem\Controllers\Metrics\Stats::databaseWrite + */ + public function testDatabase() + { + $this->initDatabase(); + + $stats = new Stats($this->database); + + $read = $stats->databaseRead(); + $write = $stats->databaseWrite(); + + $this->assertIsFloat($read); + $this->assertNotEmpty($read); + $this->assertIsFloat($write); + $this->assertNotEmpty($write); + } + + /** * @covers \Engelsystem\Controllers\Metrics\Stats::logEntries */ public function testLogEntries() |