MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / calculateWorkerStats

Function calculateWorkerStats

pkg/cmd/workerpool/view/view.go:187–219  ·  view source on GitHub ↗
(workers []*machines.Worker)

Source from the content-addressed store, hash-verified

185}
186
187func calculateWorkerStats(workers []*machines.Worker) WorkerStats {
188 stats := WorkerStats{}
189
190 for _, worker := range workers {
191 stats.Total++
192
193 if worker.IsDisabled {
194 stats.Disabled++
195 }
196
197 switch worker.HealthStatus {
198 case "Healthy":
199 stats.Healthy++
200 case "HasWarnings":
201 stats.HasWarnings++
202 case "Unhealthy":
203 stats.Unhealthy++
204 case "Unavailable":
205 stats.Unavailable++
206 }
207
208 switch worker.Endpoint.GetCommunicationStyle() {
209 case "Ssh":
210 stats.SSH++
211 case "TentaclePassive":
212 stats.ListeningTentacle++
213 case "TentacleActive":
214 stats.PollingTentacle++
215 }
216 }
217
218 return stats
219}

Callers 3

getWorkerPoolAsJsonFunction · 0.85
getWorkerPoolAsTableRowFunction · 0.85
getWorkerPoolAsBasicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected