summaryrefslogtreecommitdiff
path: root/tests/Unit/Controllers/Metrics
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-08-21 14:22:31 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-08-21 14:22:31 +0200
commitefaf29e5ef020694849039713afa0027f92f6bbe (patch)
treefd96fcd0f460a180e2399a7de2174cee86faaf00 /tests/Unit/Controllers/Metrics
parent4d4fb81cd3dbe276f684feecd03c8fc49c700df0 (diff)
Metrics: Add database access time
Diffstat (limited to 'tests/Unit/Controllers/Metrics')
-rw-r--r--tests/Unit/Controllers/Metrics/ControllerTest.php1
-rw-r--r--tests/Unit/Controllers/Metrics/StatsTest.php19
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()