Merge branch '0.13.x' of https://github.com/appwrite/appwrite into 0.13.x

This commit is contained in:
Torsten Dittmann 2022-03-02 13:21:02 +01:00
commit a7f3fde528
2 changed files with 3 additions and 3 deletions

View file

@ -1580,7 +1580,7 @@ App::get('/v1/storage/usage')
];
$metrics = [
"storage.tags.total",
"storage.deployments.total",
"storage.files.total",
"storage.files.count",
"storage.buckets.count",
@ -1635,7 +1635,7 @@ App::get('/v1/storage/usage')
$usage = new Document([
'range' => $range,
'filesStorage' => $stats['storage.files.total'],
'tagsStorage' => $stats['storage.tags.total'],
'deploymentsStorage' => $stats['storage.deployments.total'],
'filesCount' => $stats['storage.files.count'],
'bucketsCount' => $stats['storage.buckets.count'],
'bucketsCreate' => $stats['storage.buckets.create'],

View file

@ -418,7 +418,7 @@ $cli
// Get total storage
$dbForProject->setNamespace('_' . $projectId);
$storageTotal = $dbForProject->sum('tags', 'size');
$storageTotal = $dbForProject->sum('deployments', 'size');
$time = (int) (floor(time() / 1800) * 1800); // Time rounded to nearest 30 minutes
$id = \md5($time . '_30m_storage.deployments.total'); //Construct unique id for each metric using time, period and metric