diff options
author | Valery Piashchynski <[email protected]> | 2022-09-09 17:16:51 +0200 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2022-09-09 17:16:51 +0200 |
commit | bc61e69042620871b29add33eb2ff27abc3bc6a4 (patch) | |
tree | 557a5cb26d0e341aba5163a05eeaa7a2d060800d /internal | |
parent | 5a330c805b0425ca8f66d277927e7082d97cb615 (diff) |
fix: correct tables render
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/cli/workers/render.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/internal/cli/workers/render.go b/internal/cli/workers/render.go index 50984f16..df38ae85 100644 --- a/internal/cli/workers/render.go +++ b/internal/cli/workers/render.go @@ -18,7 +18,7 @@ const ( ) // WorkerTable renders table with information about rr server workers. -func WorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { +func WorkerTable(writer io.Writer, workers []*process.State) *tablewriter.Table { tw := tablewriter.NewWriter(writer) tw.SetHeader([]string{"PID", "Status", "Execs", "Memory", "CPU%", "Created"}) tw.SetColMinWidth(0, 7) @@ -30,12 +30,12 @@ func WorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { for i := 0; i < len(workers); i++ { tw.Append([]string{ - strconv.Itoa(int(workers[i].Pid())), - renderStatus(workers[i].String()), - renderJobs(workers[i].NumExecs()), - humanize.Bytes(workers[i].MemoryUsage()), - renderCPU(workers[i].CPUPercent()), - renderAlive(time.Unix(0, workers[i].Created())), + strconv.Itoa(int(workers[i].Pid)), + renderStatus(workers[i].StatusStr), + renderJobs(workers[i].NumExecs), + humanize.Bytes(workers[i].MemoryUsage), + renderCPU(workers[i].CPUPercent), + renderAlive(time.Unix(0, workers[i].Created)), }) } @@ -43,7 +43,7 @@ func WorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { } // ServiceWorkerTable renders table with information about rr server workers. -func ServiceWorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { +func ServiceWorkerTable(writer io.Writer, workers []*process.State) *tablewriter.Table { tw := tablewriter.NewWriter(writer) tw.SetAutoWrapText(false) tw.SetHeader([]string{"PID", "Memory", "CPU%", "Command"}) @@ -55,10 +55,10 @@ func ServiceWorkerTable(writer io.Writer, workers []process.State) *tablewriter. for i := 0; i < len(workers); i++ { tw.Append([]string{ - strconv.Itoa(int(workers[i].Pid())), - humanize.Bytes(workers[i].MemoryUsage()), - renderCPU(workers[i].CPUPercent()), - workers[i].Command(), + strconv.Itoa(int(workers[i].Pid)), + humanize.Bytes(workers[i].MemoryUsage), + renderCPU(workers[i].CPUPercent), + workers[i].Command, }) } |