Показатели: размер базы для MySQL считать по information_schema, а не по файлу sqlite
This commit is contained in:
1 parent
1c3afea78b
commit
8d362f29ce
2 files changed
+39
-3
No files matched your search
@@ -7,10 +7,22 @@ declare(strict_types=1);
|
||||
*/
|
||||
|
||||
use Rsgrinko\Proton\Cache\Cache;
|
||||
use Rsgrinko\Proton\Database\Connection;
|
||||
use Rsgrinko\Proton\Models\Setting;
|
||||
use Rsgrinko\Proton\Support\Metrics;
|
||||
use Rsgrinko\Proton\Support\Monitor;
|
||||
|
||||
test('показатели: размер базы считается по драйверу, а не всегда как файл sqlite', function (): void {
|
||||
$storage = Metrics::storage();
|
||||
|
||||
assertTrue($storage['database_bytes'] >= 0);
|
||||
assertTrue($storage['var_bytes'] >= 0);
|
||||
|
||||
// Тестовая база — sqlite, тут это файл; для mysql тот же метод суммирует
|
||||
// data_length + index_length по information_schema.tables (см. Metrics::databaseBytes)
|
||||
assertTrue(Connection::instance()->isSqlite(), 'тесты всегда идут на своей sqlite');
|
||||
});
|
||||
|
||||
test('показатели: запросы складываются, ошибки и медленные считаются отдельно', function (): void {
|
||||
Cache::flush();
|
||||
|
||||
|
||||
Reference in new issue
Block a user