This commit is contained in:
Damodar Lohani
2025-03-06 06:18:49 +00:00
parent 918b4c3ae4
commit ef2fe4a197
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -4317,7 +4317,7 @@ App::get('/v1/databases/:databaseId/usage')
Authorization::skip(function () use ($dbForLogs, $days, $logsDBMetrics, &$stats) {
foreach ($logsDBMetrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
$result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result->getAttribute('value', 0);
$limit = $days['limit'];
@@ -4344,7 +4344,7 @@ App::get('/v1/databases/:databaseId/usage')
Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) {
foreach ($metrics as $metric) {
$result = $dbForProject->getDocument('stats', '_inf_' . $metric);
$result = $dbForProject->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
@@ -4442,7 +4442,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage')
Authorization::skip(function () use ($dbForLogs, $days, $metrics, &$stats) {
foreach ($metrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
$result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
+5 -5
View File
@@ -641,8 +641,8 @@ App::get('/v1/functions/:functionId/usage')
Authorization::skip(function () use ($dbForLogs, $days, $logsDBMetrics, &$stats) {
foreach ($logsDBMetrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
$stats[$metric]['total'] = $result['value'] ?? 0;
$result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result->getAttribute('value', 0);
$limit = $days['limit'];
$period = $days['period'];
@@ -670,7 +670,7 @@ App::get('/v1/functions/:functionId/usage')
Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) {
foreach ($metrics as $metric) {
$result = $dbForProject->getDocument('stats', '_inf_' . $metric);
$result = $dbForProject->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
@@ -768,7 +768,7 @@ App::get('/v1/functions/usage')
Authorization::skip(function () use ($dbForLogs, $days, $logsDBMetrics, &$stats) {
foreach ($logsDBMetrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
$result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
@@ -797,7 +797,7 @@ App::get('/v1/functions/usage')
Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) {
foreach ($metrics as $metric) {
$result = $dbForProject->getDocument('stats', '_inf_' . $metric);
$result = $dbForProject->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
+2 -2
View File
@@ -1799,7 +1799,7 @@ App::get('/v1/storage/usage')
$total = [];
Authorization::skip(function () use ($dbForLogs, $days, $metrics, &$stats, &$total) {
foreach ($metrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
($result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];
@@ -1889,7 +1889,7 @@ App::get('/v1/storage/:bucketId/usage')
Authorization::skip(function () use ($dbForLogs, $bucket, $days, $metrics, &$stats) {
foreach ($metrics as $metric) {
$result = $dbForLogs->getDocument('stats', '_inf_' . $metric);
$result = $dbForLogs->getDocument('stats', md5('_inf_' . $metric));
$stats[$metric]['total'] = $result['value'] ?? 0;
$limit = $days['limit'];