Fixed peak connections count not being able to settle down

This commit is contained in:
Alex Renoki 2020-12-07 23:15:09 +02:00
parent 19ca49a4a8
commit 8d1369ee02
2 changed files with 2 additions and 2 deletions

View File

@ -249,7 +249,7 @@ class RedisCollector extends MemoryCollector
$this->channelManager->getPublishClient()->hset( $this->channelManager->getPublishClient()->hset(
$this->channelManager->getRedisKey($appId, null, ['stats']), $this->channelManager->getRedisKey($appId, null, ['stats']),
'peak_connections_count', $currentConnectionCount 'peak_connections_count', max(0, $currentConnectionCount)
); );
$this->channelManager->getPublishClient()->hset( $this->channelManager->getPublishClient()->hset(

View File

@ -178,7 +178,7 @@ class Statistic
public function reset(int $currentConnectionsCount) public function reset(int $currentConnectionsCount)
{ {
$this->currentConnectionsCount = $currentConnectionsCount; $this->currentConnectionsCount = $currentConnectionsCount;
$this->peakConnectionsCount = $currentConnectionsCount; $this->peakConnectionsCount = max(0, $currentConnectionsCount);
$this->webSocketMessagesCount = 0; $this->webSocketMessagesCount = 0;
$this->apiMessagesCount = 0; $this->apiMessagesCount = 0;
} }