@@ -99,20 +99,22 @@ protected function checkPod(K8sPod $pod, int $memoryThreshold, string $probesTok
99
99
$ rejectsNewConnections = $ pod ->getLabel ('echo.soketi.app/rejects-new-connections ' , 'no ' );
100
100
$ dateTime = now ()->toDateTimeString ();
101
101
102
+ $ this ->line ("[ {$ dateTime }] Current memory usage is {$ memoryUsagePercentage }%. Checking... " , null , 'v ' );
103
+
102
104
if ($ memoryUsagePercentage >= $ memoryThreshold ) {
103
105
if ($ rejectsNewConnections === 'no ' ) {
104
106
$ this ->info ("[ {$ dateTime }] Pod now rejects connections. " );
105
- $ this ->info ("[ {$ dateTime }] Pod uses {$ memoryUsagePercentage }, threshold is {$ memoryThreshold }. " );
106
- }
107
+ $ this ->info ("[ {$ dateTime }] Echo container uses {$ memoryUsagePercentage }%, threshold is {$ memoryThreshold }% " );
107
108
108
- $ this ->rejectNewConnections ($ pod , $ probesToken , $ echoAppPort );
109
+ $ this ->rejectNewConnections ($ pod , $ probesToken , $ echoAppPort );
110
+ }
109
111
} else {
110
112
if ($ rejectsNewConnections === 'yes ' ) {
111
- $ this ->info ("[ {$ dateTime }] Pod now accepts connections (memory usage: {$ memoryUsagePercentage }% RAM used. " );
112
- $ this ->info ("[ {$ dateTime }] Pod uses {$ memoryUsagePercentage }, threshold is {$ memoryThreshold }. " );
113
- }
113
+ $ this ->info ("[ {$ dateTime }] Pod now accepts connections. " );
114
+ $ this ->info ("[ {$ dateTime }] Echo container uses {$ memoryUsagePercentage }%, threshold is {$ memoryThreshold }% " );
114
115
115
- $ this ->acceptNewConnections ($ pod , $ probesToken , $ echoAppPort );
116
+ $ this ->acceptNewConnections ($ pod , $ probesToken , $ echoAppPort );
117
+ }
116
118
}
117
119
}
118
120
0 commit comments