EXPERIMENTAL: DebugState prints the state of all PHP threads - debugging purposes only
()
| 29 | |
| 30 | // EXPERIMENTAL: DebugState prints the state of all PHP threads - debugging purposes only |
| 31 | func DebugState() FrankenPHPDebugState { |
| 32 | fullState := FrankenPHPDebugState{ |
| 33 | ThreadDebugStates: make([]ThreadDebugState, 0, len(phpThreads)), |
| 34 | ReservedThreadCount: 0, |
| 35 | } |
| 36 | for _, thread := range phpThreads { |
| 37 | if thread.state.Is(state.Reserved) { |
| 38 | fullState.ReservedThreadCount++ |
| 39 | continue |
| 40 | } |
| 41 | fullState.ThreadDebugStates = append(fullState.ThreadDebugStates, threadDebugState(thread)) |
| 42 | } |
| 43 | |
| 44 | return fullState |
| 45 | } |
| 46 | |
| 47 | // threadDebugState creates a small jsonable status message for debugging purposes |
| 48 | func threadDebugState(thread *phpThread) ThreadDebugState { |
no test coverage detected