Skip to content

Commit

Permalink
feat(debug): Measure the pushing time
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Dec 14, 2023
1 parent 0e368dc commit 11de5d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ protected function sendNotificationsToProxies(): void {

$client = $this->clientService->newClient();
foreach ($pushNotifications as $proxyServer => $notifications) {
$start = microtime(true);
try {
$requestData = [
'body' => [
Expand Down Expand Up @@ -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));
}
}
}

Expand Down

0 comments on commit 11de5d4

Please sign in to comment.