summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-09-09 17:14:20 +0200
committerValery Piashchynski <[email protected]>2022-09-09 17:14:20 +0200
commit5a330c805b0425ca8f66d277927e7082d97cb615 (patch)
tree8253071ae913b76e6345ec4442748f28ef807716 /internal
parente044c06b7146e7d62690eeed406fbad55244c935 (diff)
feat: release v2.11.2
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'internal')
-rw-r--r--internal/cli/workers/render.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/internal/cli/workers/render.go b/internal/cli/workers/render.go
index 2d3cc71b..50984f16 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(workers[i].Pid),
- renderStatus(workers[i].Status),
- renderJobs(workers[i].NumJobs),
- 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].String()),
+ 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(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(),
})
}