From 779cc3f5aebb749ab4bc6190e03cc86ff3f151a0 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 19 Apr 2021 21:00:11 +0300 Subject: - Add command information to the `./rr workers` info Signed-off-by: Valery Piashchynski --- tools/worker_table.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/worker_table.go') 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, }) } -- cgit v1.2.3