From 11de5d428a4e8ef7b71c35e2320ee6dabeabc8e3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 14 Dec 2023 10:48:27 +0100 Subject: [PATCH] feat(debug): Measure the pushing time Signed-off-by: Joas Schilling --- lib/Push.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Push.php b/lib/Push.php index 7bcaa8681..9634b9bdd 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -493,6 +493,7 @@ protected function sendNotificationsToProxies(): void { $client = $this->clientService->newClient(); foreach ($pushNotifications as $proxyServer => $notifications) { + $start = microtime(true); try { $requestData = [ 'body' => [ @@ -575,6 +576,11 @@ protected function sendNotificationsToProxies(): void { 'app' => 'notifications', ]); } + + $end = microtime(true); + if (isset($_SERVER['REQUEST_URI']) && str_contains($_SERVER['REQUEST_URI'], 'apps/spreed/api/v4/call/')) { + error_log('[' . get_class($this) . '] Pushing to ' . $proxyServer . ' - ' . ($end - $start)); + } } }