Fixed peak connections count not being able to settle down
This commit is contained in:
parent
19ca49a4a8
commit
8d1369ee02
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue