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

Function getWorkerPoolAsTableRow

pkg/cmd/workerpool/view/view.go:108–127  ·  view source on GitHub ↗
(opts *shared.ViewOptions, workerPool workerpools.IWorkerPool)

Source from the content-addressed store, hash-verified

106}
107
108func getWorkerPoolAsTableRow(opts *shared.ViewOptions, workerPool workerpools.IWorkerPool) []string {
109 workers, _ := getWorkers(opts, workerPool)
110 workerStats := calculateWorkerStats(workers)
111
112 defaultStatus := ""
113 if workerPool.GetIsDefault() {
114 defaultStatus = output.Green("Yes")
115 } else {
116 defaultStatus = "No"
117 }
118
119 return []string{
120 output.Bold(workerPool.GetName()),
121 string(workerPool.GetWorkerPoolType()),
122 defaultStatus,
123 fmt.Sprintf("%d", workerStats.Total),
124 output.Greenf("%d", workerStats.Healthy),
125 output.Redf("%d", workerStats.Unhealthy+workerStats.Unavailable),
126 }
127}
128
129func getWorkerPoolAsBasic(opts *shared.ViewOptions, workerPool workerpools.IWorkerPool) string {
130 var result strings.Builder

Callers 1

ViewRunFunction · 0.85

Calls 7

GreenFunction · 0.92
BoldFunction · 0.92
GreenfFunction · 0.92
RedfFunction · 0.92
getWorkersFunction · 0.85
calculateWorkerStatsFunction · 0.85
GetNameMethod · 0.65

Tested by

no test coverage detected