MCPcopy Index your code
hub / github.com/DarthSim/overmind / processStatus

Method processStatus

start/command_center.go:172–200  ·  view source on GitHub ↗
(conn net.Conn)

Source from the content-addressed store, hash-verified

170}
171
172func (c *commandCenter) processStatus(conn net.Conn) {
173 maxNameLen := 9
174 for _, p := range c.cmd.processes {
175 if l := len(p.Name); l > maxNameLen {
176 maxNameLen = l
177 }
178 }
179
180 fmt.Fprint(conn, headerProcess)
181 for i := maxNameLen - len(headerProcess); i > -1; i-- {
182 conn.Write([]byte{' '})
183 }
184
185 fmt.Fprint(conn, headerPid)
186 fmt.Fprint(conn, " ")
187 fmt.Fprintln(conn, headerStatus)
188
189 for _, p := range c.cmd.processes {
190 utils.FprintRpad(conn, p.Name, maxNameLen+1)
191 utils.FprintRpad(conn, strconv.Itoa(p.pid), 10)
192
193 if p.dead || p.keepingAlive {
194 fmt.Fprintln(conn, "dead")
195 } else {
196 fmt.Fprintln(conn, "running")
197 }
198 }
199 conn.Close()
200}

Callers 1

handleConnectionMethod · 0.95

Calls 1

FprintRpadFunction · 0.92

Tested by

no test coverage detected