Merge pull request #9491 from appwrite/feat-add-timings-to-stats-resources

Feat: calculate and log time taken for each project
This commit is contained in:
Damodar Lohani 2025-03-12 16:28:11 +05:45 committed by GitHub
commit 7f76bfed11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,10 +77,13 @@ class StatsResources extends Action
// Reset documents for each job
$this->documents = [];
$startTime = microtime(true);
$this->countForProject($dbForPlatform, $getLogsDB, $getProjectDB, $project);
$endTime = microtime(true);
$executionTime = $endTime - $startTime;
Console::info('Project: ' . $project->getId() . '(' . $project->getInternalId() . ') aggregated in ' . $executionTime .' seconds');
}
protected function countForProject(Database $dbForPlatform, callable $getLogsDB, callable $getProjectDB, Document $project): void
{
Console::info('Begining count for: ' . $project->getId());