collections count
This commit is contained in:
parent
218b332b0f
commit
80fffe0ed4
|
@ -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]);
|
$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;
|
$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]);
|
$storageTotal = $dbForInternal->findOne('stats', [new Query('metric', Query::TYPE_EQUAL, ['storage.total'])], 0, ['time'], [Database::ORDER_DESC]);
|
||||||
$storage = $storageTotal ? $storageTotal->getAttribute('value', 0) : 0;
|
$storage = $storageTotal ? $storageTotal->getAttribute('value', 0) : 0;
|
||||||
|
@ -320,6 +323,10 @@ App::get('/v1/projects/:projectId/usage')
|
||||||
'data' => [],
|
'data' => [],
|
||||||
'total' => $documentsTotal,
|
'total' => $documentsTotal,
|
||||||
],
|
],
|
||||||
|
'collections' => [
|
||||||
|
'data' => [],
|
||||||
|
'total' => $collectionsTotal,
|
||||||
|
],
|
||||||
'users' => [
|
'users' => [
|
||||||
'data' => [],
|
'data' => [],
|
||||||
'total' => $usersTotal,
|
'total' => $usersTotal,
|
||||||
|
|
Loading…
Reference in a new issue