diff --git a/lib/Push.php b/lib/Push.php index b34984b45..7bcaa8681 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -268,6 +268,7 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf return; } + $start = microtime(true); $user = $this->createFakeUserObject($notification->getUser()); if (!array_key_exists($notification->getUser(), $this->userStatuses)) { @@ -304,6 +305,7 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf $language = $this->l10nFactory->getUserLanguage($user); $this->printInfo('Language is set to ' . $language); + $start1 = microtime(true); try { $this->notificationManager->setPreparingPushNotification(true); $notification = $this->notificationManager->prepare($notification, $language); @@ -312,6 +314,10 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf } finally { $this->notificationManager->setPreparingPushNotification(false); } + $end1 = microtime(true); + if (isset($_SERVER['REQUEST_URI']) && str_contains($_SERVER['REQUEST_URI'], 'apps/spreed/api/v4/call/')) { + error_log('[' . get_class($this) . '] Preparing Notification #' . $id . ' - ' . ($end1 - $start1)); + } $userKey = $this->keyManager->getKey($user); @@ -353,6 +359,11 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf } } + $end = microtime(true); + if (isset($_SERVER['REQUEST_URI']) && str_contains($_SERVER['REQUEST_URI'], 'apps/spreed/api/v4/call/')) { + error_log('[' . get_class($this) . '] Total Notification for ' . $notification->getUser() . ' - ' . ($end - $start)); + } + if (!$this->deferPayloads) { $this->sendNotificationsToProxies(); }