|
@@ 161-167 (lines=7) @@
|
| 158 |
|
* @param int $currentConnectionCount |
| 159 |
|
* @return void |
| 160 |
|
*/ |
| 161 |
|
public function resetStatistics($appId, int $currentConnectionCount) |
| 162 |
|
{ |
| 163 |
|
$this->redis->hset($this->getHash($appId), 'current_connection_count', $currentConnectionCount); |
| 164 |
|
$this->redis->hset($this->getHash($appId), 'peak_connection_count', $currentConnectionCount); |
| 165 |
|
$this->redis->hset($this->getHash($appId), 'websocket_message_count', 0); |
| 166 |
|
$this->redis->hset($this->getHash($appId), 'api_message_count', 0); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
/** |
| 170 |
|
* Remove all app traces from the database if no connections have been set |
|
@@ 176-184 (lines=9) @@
|
| 173 |
|
* @param mixed $appId |
| 174 |
|
* @return void |
| 175 |
|
*/ |
| 176 |
|
public function resetAppTraces($appId) |
| 177 |
|
{ |
| 178 |
|
$this->redis->hdel($this->getHash($appId), 'current_connection_count'); |
| 179 |
|
$this->redis->hdel($this->getHash($appId), 'peak_connection_count'); |
| 180 |
|
$this->redis->hdel($this->getHash($appId), 'websocket_message_count'); |
| 181 |
|
$this->redis->hdel($this->getHash($appId), 'api_message_count'); |
| 182 |
|
|
| 183 |
|
$this->redis->srem('laravel-websockets:apps', $appId); |
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
/** |
| 187 |
|
* Get the Redis hash name for the app. |