@@ -84,17 +84,18 @@ private function checkWorkerModeStatus(): void
8484
8585 $ workerStatus = Measure::getWorkerStatus ();
8686
87- if (!$ workerStatus ['worker_mode ' ]) {
87+ if (! $ workerStatus ['worker_mode ' ]) {
8888 $ this ->line (' ⚠️ Not running in FrankenPHP worker mode ' );
8989 $ this ->line ('' );
90+
9091 return ;
9192 }
9293
93- $ this ->line (" 🔄 Worker Mode: <info>Active</info> " );
94+ $ this ->line (' 🔄 Worker Mode: <info>Active</info> ' );
9495 $ this ->line (" 🆔 Process ID: <info> {$ workerStatus ['pid ' ]}</info> " );
95- $ this ->line (" 📊 Memory Usage: <info> " . $ this ->formatBytes ($ workerStatus ['memory_usage ' ]) . " </info> " );
96- $ this ->line (" 📈 Peak Memory: <info> " . $ this ->formatBytes ($ workerStatus ['peak_memory ' ]) . " </info> " );
97- $ this ->line (" 🎯 Current Span Recording: <info> " . ($ workerStatus ['current_span_recording ' ] ? 'Yes ' : 'No ' ) . " </info> " );
96+ $ this ->line (' 📊 Memory Usage: <info> ' . $ this ->formatBytes ($ workerStatus ['memory_usage ' ]). ' </info> ' );
97+ $ this ->line (' 📈 Peak Memory: <info> ' . $ this ->formatBytes ($ workerStatus ['peak_memory ' ]). ' </info> ' );
98+ $ this ->line (' 🎯 Current Span Recording: <info> ' . ($ workerStatus ['current_span_recording ' ] ? 'Yes ' : 'No ' ). ' </info> ' );
9899 $ this ->line (" 🔗 Trace ID: <info> {$ workerStatus ['trace_id ' ]}</info> " );
99100
100101 $ this ->line ('' );
@@ -128,7 +129,7 @@ private function checkOpenTelemetryIntegration(): void
128129 */
129130 private function displayWorkerStats (): void
130131 {
131- if (!class_exists (FrankenPhpWorkerWatcher::class)) {
132+ if (! class_exists (FrankenPhpWorkerWatcher::class)) {
132133 return ;
133134 }
134135
@@ -138,14 +139,14 @@ private function displayWorkerStats(): void
138139 $ stats = FrankenPhpWorkerWatcher::getWorkerStats ();
139140
140141 $ this ->line (" 📈 Request Count: <info> {$ stats ['request_count ' ]}</info> " );
141- $ this ->line (" 💾 Current Memory: <info> " . $ this ->formatBytes ($ stats ['current_memory ' ]) . " </info> " );
142- $ this ->line (" 📊 Peak Memory: <info> " . $ this ->formatBytes ($ stats ['peak_memory ' ]) . " </info> " );
143- $ this ->line (" 🔺 Memory Increase: <info> " . $ this ->formatBytes ($ stats ['memory_increase ' ]) . " </info> " );
144- $ this ->line (" 🏁 Initial Memory: <info> " . $ this ->formatBytes ($ stats ['initial_memory ' ]) . " </info> " );
142+ $ this ->line (' 💾 Current Memory: <info> ' . $ this ->formatBytes ($ stats ['current_memory ' ]). ' </info> ' );
143+ $ this ->line (' 📊 Peak Memory: <info> ' . $ this ->formatBytes ($ stats ['peak_memory ' ]). ' </info> ' );
144+ $ this ->line (' 🔺 Memory Increase: <info> ' . $ this ->formatBytes ($ stats ['memory_increase ' ]). ' </info> ' );
145+ $ this ->line (' 🏁 Initial Memory: <info> ' . $ this ->formatBytes ($ stats ['initial_memory ' ]). ' </info> ' );
145146
146147 // 内存增长警告
147148 if ($ stats ['memory_increase ' ] > 50 * 1024 * 1024 ) { // 50MB
148- $ this ->warn (" ⚠️ High memory increase detected! " );
149+ $ this ->warn (' ⚠️ High memory increase detected! ' );
149150 }
150151
151152 } catch (\Throwable $ e ) {
@@ -167,8 +168,8 @@ private function displayMemoryUsage(): void
167168 $ peakMemory = memory_get_peak_usage (true );
168169
169170 $ this ->line (" 📊 Memory Limit: <info> {$ memoryLimit }</info> " );
170- $ this ->line (" 📈 Current Usage: <info> " . $ this ->formatBytes ($ currentMemory ) . " </info> " );
171- $ this ->line (" 🔝 Peak Usage: <info> " . $ this ->formatBytes ($ peakMemory ) . " </info> " );
171+ $ this ->line (' 📈 Current Usage: <info> ' . $ this ->formatBytes ($ currentMemory ). ' </info> ' );
172+ $ this ->line (' 🔝 Peak Usage: <info> ' . $ this ->formatBytes ($ peakMemory ). ' </info> ' );
172173
173174 // 计算内存使用率
174175 if ($ memoryLimit !== '-1 ' ) {
@@ -178,7 +179,7 @@ private function displayMemoryUsage(): void
178179 $ this ->line (" 📊 Usage Percentage: <info> {$ usagePercent }%</info> " );
179180
180181 if ($ usagePercent > 80 ) {
181- $ this ->warn (" ⚠️ High memory usage detected! " );
182+ $ this ->warn (' ⚠️ High memory usage detected! ' );
182183 }
183184 }
184185 }
@@ -222,7 +223,7 @@ private function formatBytes(int $bytes): string
222223
223224 $ bytes /= (1 << (10 * $ pow ));
224225
225- return round ($ bytes , 2 ) . ' ' . $ units [$ pow ];
226+ return round ($ bytes , 2 ). ' ' . $ units [$ pow ];
226227 }
227228
228229 /**
0 commit comments