mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
collections count
This commit is contained in:
@@ -290,6 +290,9 @@ App::get('/v1/projects/:projectId/usage')
|
||||
|
||||
$documentsCount = $dbForInternal->findOne('stats', [new Query('metric', Query::TYPE_EQUAL, ['database.documents.count'])], 0, ['time'], [Database::ORDER_DESC]);
|
||||
$documentsTotal = $documentsCount ? $documentsCount->getAttribute('value', 0) : 0;
|
||||
|
||||
$collectionsCount = $dbForInternal->findOne('stats', [new Query('metric', Query::TYPE_EQUAL, ['database.collections.count'])], 0, ['time'], [Database::ORDER_DESC]);
|
||||
$collectionsTotal = $collectionsCount ? $collectionsCount->getAttribute('value', 0) : 0;
|
||||
|
||||
$storageTotal = $dbForInternal->findOne('stats', [new Query('metric', Query::TYPE_EQUAL, ['storage.total'])], 0, ['time'], [Database::ORDER_DESC]);
|
||||
$storage = $storageTotal ? $storageTotal->getAttribute('value', 0) : 0;
|
||||
@@ -320,6 +323,10 @@ App::get('/v1/projects/:projectId/usage')
|
||||
'data' => [],
|
||||
'total' => $documentsTotal,
|
||||
],
|
||||
'collections' => [
|
||||
'data' => [],
|
||||
'total' => $collectionsTotal,
|
||||
],
|
||||
'users' => [
|
||||
'data' => [],
|
||||
'total' => $usersTotal,
|
||||
|
||||
Reference in New Issue
Block a user