(workers []*machines.Worker)
| 185 | } |
| 186 | |
| 187 | func 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 | } |
no outgoing calls
no test coverage detected