From bdd1d4c6b6d55a0b96a515b90ff5b1a33a1f1221 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 27 Jan 2022 13:31:06 +0545 Subject: [PATCH] remove file sum from tags total --- app/tasks/usage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/tasks/usage.php b/app/tasks/usage.php index f7cca572e2..b2786aa355 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -404,7 +404,7 @@ $cli // Get total storage $dbForProject->setNamespace('_project_' . $projectId); - $storageTotal = $dbForProject->sum('files', 'sizeOriginal') + $dbForProject->sum('tags', 'size'); + $storageTotal = $dbForProject->sum('tags', 'size'); $time = (int) (floor(time() / 1800) * 1800); // Time rounded to nearest 30 minutes $id = \md5($time . '_30m_storage.tags.total'); //Construct unique id for each metric using time, period and metric @@ -427,7 +427,7 @@ $cli } $time = (int) (floor(time() / 86400) * 86400); // Time rounded to nearest day - $id = \md5($time . '_1d_storage.total'); //Construct unique id for each metric using time, period and metric + $id = \md5($time . '_1d_storage.tags.total'); //Construct unique id for each metric using time, period and metric $document = $dbForProject->getDocument('stats', $id); if ($document->isEmpty()) { $dbForProject->createDocument('stats', new Document([