This commit is contained in:
shimon 2024-10-07 17:56:08 +03:00
parent 1cd3e69161
commit d2c66894fd
3 changed files with 16 additions and 16 deletions

View file

@ -89,10 +89,10 @@ App::post('/v1/projects')
->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Request $request, Response $response, Database $dbForConsole, Cache $cache, Group $pools, Hooks $hooks) {
$ctime = \microtime(true);
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - Before getDocument('teams')");
var_dump($request->getURI() . " [".$region."|".System::getEnv('_APP_REGION')."] - Before getDocument('teams')");
$team = $dbForConsole->getDocument('teams', $teamId);
$diff = \microtime(true) - $ctime;
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - After getDocument('teams') : " . $diff . " sec");
var_dump($request->getURI() . " [".$region."|".System::getEnv('_APP_REGION')."] - After getDocument('teams') : " . $diff . " sec");
if ($team->isEmpty()) {
throw new Exception(Exception::TEAM_NOT_FOUND);
@ -160,7 +160,7 @@ App::post('/v1/projects')
try {
$ctime = \microtime(true);
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - Before createDocument('projects')");
var_dump($request->getURI() . " [".$region."|".System::getEnv('_APP_REGION')."] - Before createDocument('projects')");
$project = $dbForConsole->createDocument('projects', new Document([
'$id' => $projectId,
'$permissions' => [
@ -196,7 +196,7 @@ App::post('/v1/projects')
]));
$diff = \microtime(true) - $ctime;
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - After createDocument('projects') : " . $diff . " sec");
var_dump($request->getURI() . " [".$region."|".System::getEnv('_APP_REGION')."] - After createDocument('projects') : " . $diff . " sec");
} catch (Duplicate) {
throw new Exception(Exception::PROJECT_ALREADY_EXISTS);
}
@ -249,10 +249,10 @@ App::post('/v1/projects')
try {
$ctime = \microtime(true);
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - Before createCollection('".$key."')");
var_dump($request->getURI() ." [".$region."|".System::getEnv('_APP_REGION')."] - Before createCollection('".$key."')");
$dbForProject->createCollection($key, $attributes, $indexes);
$diff = \microtime(true) - $ctime;
var_dump("[".$region."|".System::getEnv('_APP_REGION')."] - After createCollection('".$key."') : " . $diff . " sec");
var_dump($request->getURI() . " [".$region."|".System::getEnv('_APP_REGION')."] - After createCollection('".$key."') : " . $diff . " sec");
} catch (Duplicate) {
// Collection already exists
}

View file

@ -463,7 +463,7 @@ App::init()
$ctime = \microtime(true);
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before general first init hook");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before general first init hook");
$host = $request->getHostname() ?? '';
$mainDomain = System::getEnv('_APP_DOMAIN', '');
// Only run Router when external domain
@ -667,7 +667,7 @@ App::init()
}
$diff = \microtime(true) - $ctime;
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After general first init hook : " . $diff . " sec");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After general first init hook : " . $diff . " sec");
});
App::options()

View file

@ -163,7 +163,7 @@ App::init()
->inject('team')
->action(function (App $utopia, Request $request, Database $dbForConsole, Document $project, Document $user, ?Document $session, array $servers, string $mode, Document $team) {
$ctime = \microtime(true);
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api first init hook");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api first init hook");
$route = $utopia->getRoute();
@ -348,7 +348,7 @@ App::init()
}
}
$diff = \microtime(true) - $ctime;
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api first init hook : " . $diff . " sec");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api first init hook : " . $diff . " sec");
});
App::init()
@ -369,7 +369,7 @@ App::init()
->inject('mode')
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode) use ($databaseListener) {
$ctime = \microtime(true);
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api second init hook");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api second init hook");
$route = $utopia->getRoute();
if (
@ -528,7 +528,7 @@ App::init()
}
}
$diff = \microtime(true) - $ctime;
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api second init hook : " . $diff . " sec");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api second init hook : " . $diff . " sec");
});
App::init()
@ -560,7 +560,7 @@ App::shutdown()
->inject('dbForProject')
->action(function (App $utopia, Request $request, Response $response, Document $project, Database $dbForProject) {
$ctime = \microtime(true);
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api first shutdown hook");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api first shutdown hook");
$route = $utopia->getRoute();
$sessionLimit = $project->getAttribute('auths', [])['maxSessions'] ?? APP_LIMIT_USER_SESSIONS_DEFAULT;
$session = $response->getPayload();
@ -587,7 +587,7 @@ App::shutdown()
$dbForProject->purgeCachedDocument('users', $userId);
$diff = \microtime(true) - $ctime;
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api first shutdown hook : " . $diff . " sec");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api first shutdown hook : " . $diff . " sec");
});
App::shutdown()
@ -611,7 +611,7 @@ App::shutdown()
->inject('realtimeConnection')
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Audit $queueForAudits, Usage $queueForUsage, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Messaging $queueForMessaging, Database $dbForProject, Func $queueForFunctions, string $mode, Database $dbForConsole, callable $realtimeConnection) use ($parseLabel) {
$ctime = \microtime(true);
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api second shutdown hook");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - Before shared api second shutdown hook");
$route = $utopia->getRoute();
$responsePayload = $response->getPayload();
@ -816,7 +816,7 @@ App::shutdown()
}
}
$diff = \microtime(true) - $ctime;
var_dump("[".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api second shutdown hook : " . $diff . " sec");
var_dump($request->getURI() . " [".$project->getAttribute('region')."|".System::getEnv('_APP_REGION')."] - After shared api second shutdown hook : " . $diff . " sec");
});
App::init()