66use Appwrite \Runtimes \Runtimes as AppwriteRuntimes ;
77use OpenRuntimes \Executor \Exception ;
88use OpenRuntimes \Executor \Runner \Repository \Runtimes ;
9- use OpenRuntimes \Executor \Stats ;
109use OpenRuntimes \Executor \StorageFactory ;
11- use OpenRuntimes \Executor \Usage ;
1210use OpenRuntimes \Executor \Validator \TCP ;
1311use Swoole \Process ;
1412use Swoole \Timer ;
2624
2725class Docker extends Adapter
2826{
29- private Stats $ stats ;
30-
3127 /**
3228 * @param Orchestration $orchestration
3329 * @param Runtimes $runtimes
@@ -38,7 +34,6 @@ public function __construct(
3834 private readonly Runtimes $ runtimes ,
3935 private readonly NetworkManager $ networkManager
4036 ) {
41- $ this ->stats = new Stats ();
4237 $ this ->init ();
4338 }
4439
@@ -132,25 +127,6 @@ private function init(): void
132127
133128 Console::success ('Maintenance interval started. ' );
134129
135- /**
136- * Get usage stats every X seconds to update swoole table
137- */
138- Console::info ('Starting stats interval... ' );
139- $ getStats = function (): void {
140- // Get usage stats
141- $ usage = new Usage ($ this ->orchestration );
142- $ usage ->run ();
143- $ this ->stats ->updateStats ($ usage );
144- };
145-
146- // Load initial stats in blocking way
147- $ getStats ();
148-
149- // Setup infinite recursion in non-blocking way
150- \go (fn () => Timer::after (1000 , fn () => $ getStats ()));
151-
152- Console::success ('Stats interval started. ' );
153-
154130 Process::signal (SIGINT , fn () => $ this ->cleanUp ());
155131 Process::signal (SIGQUIT , fn () => $ this ->cleanUp ());
156132 Process::signal (SIGKILL , fn () => $ this ->cleanUp ());
@@ -1236,9 +1212,4 @@ public function getRuntime(string $name): mixed
12361212
12371213 return $ runtime ->toArray ();
12381214 }
1239-
1240- public function getStats (): Stats
1241- {
1242- return $ this ->stats ;
1243- }
12441215}
0 commit comments