From 0ea196d21c3a76fcee5d04fc3024fba1d6d6eadd Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 6 Mar 2026 15:37:30 +0530 Subject: [PATCH] updated inbound raw size to the request size --- app/realtime.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/realtime.php b/app/realtime.php index 8250a395a9..9ab6601ed7 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -720,18 +720,11 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, throw new Exception(Exception::REALTIME_TOO_MANY_MESSAGES, 'Too many requests'); } - // Record realtime inbound bytes for this project (WS handshake + query params) - try { - $rawSize = $request->getSize(); - } catch (Throwable) { - $rawSize = \strlen((string) $request->getURI()); - } + $rawSize = $request->getSize(); - if ($rawSize > 0) { - triggerStats([ - METRIC_REALTIME_INBOUND => $rawSize, - ], $project->getId()); - } + triggerStats([ + METRIC_REALTIME_INBOUND => $rawSize, + ], $project->getId()); /* * Validate Client Domain - Check to avoid CSRF attack.