summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-04-19 21:00:11 +0300
committerValery Piashchynski <[email protected]>2021-04-19 21:00:11 +0300
commit779cc3f5aebb749ab4bc6190e03cc86ff3f151a0 (patch)
treed36dc3ce9a36fff1b15b8795e8fa08d397317d14 /tools
parent885b65aa3964d68c63e46031e6c8b65a05a15be8 (diff)
- Add command information to the `./rr workers` info
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/worker_table.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/worker_table.go b/tools/worker_table.go
index 7887a478..4dd70d8e 100644
--- a/tools/worker_table.go
+++ b/tools/worker_table.go
@@ -39,16 +39,20 @@ 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 {
tw := tablewriter.NewWriter(writer)
- tw.SetHeader([]string{"PID", "Memory", "CPU%"})
+ tw.SetAutoWrapText(false)
+ tw.SetHeader([]string{"PID", "Memory", "CPU%", "Command"})
tw.SetColMinWidth(0, 7)
tw.SetColMinWidth(1, 7)
tw.SetColMinWidth(2, 7)
+ tw.SetColMinWidth(3, 18)
+ tw.SetAlignment(tablewriter.ALIGN_LEFT)
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,
})
}