From 789d5d33abaac20fcaa9ade7b959e90e1029d7e3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 24 Feb 2022 07:28:49 +0000 Subject: [PATCH] fix usage for tags -> deployments --- app/tasks/usage.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 0ee28f5cb6..18e3ed8271 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -416,17 +416,17 @@ $cli // Get total storage $dbForProject->setNamespace('_project_' . $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.tags.total'); //Construct unique id for each metric using time, period and metric + $id = \md5($time . '_30m_storage.deployments.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([ '$id' => $id, 'period' => '30m', 'time' => $time, - 'metric' => 'storage.tags.total', + 'metric' => 'storage.deployments.total', 'value' => $storageTotal, 'type' => 1, ])); @@ -439,14 +439,14 @@ $cli } $time = (int) (floor(time() / 86400) * 86400); // Time rounded to nearest day - $id = \md5($time . '_1d_storage.tags.total'); //Construct unique id for each metric using time, period and metric + $id = \md5($time . '_1d_storage.deployments.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([ '$id' => $id, 'period' => '1d', 'time' => $time, - 'metric' => 'storage.tags.total', + 'metric' => 'storage.deployments.total', 'value' => $storageTotal, 'type' => 1, ]));