1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

fix storage.total usage

This commit is contained in:
Damodar Lohani 2022-04-21 11:16:21 +00:00
parent 59af8d9c86
commit a18ea60168

View file

@ -757,7 +757,6 @@ $cli
// aggregate storage.total = storage.files.total + storage.deployments.total
if($metricPrefix === 'storage' && $subCollection === 'files') {
Console::info("Aggregating `storage.total`");
$metric = 'storage.total';
$time = (int) (floor(time() / 1800) * 1800); // Time rounded to nearest 30 minutes
$id = \md5($time . '_30m_' . $metric); //Construct unique id for each metric using time, period and metric
@ -773,7 +772,7 @@ $cli
]));
} else {
$dbForProject->updateDocument('stats', $document->getId(),
$document->setAttribute('value', $count));
$document->setAttribute('value', $count + $deploymentsTotal));
}
$time = (int) (floor(time() / 86400) * 86400); // Time rounded to nearest day
@ -790,7 +789,7 @@ $cli
]));
} else {
$dbForProject->updateDocument('stats', $document->getId(),
$document->setAttribute('value', $count));
$document->setAttribute('value', $count + $deploymentsTotal));
}
}
}