From bda8614d4ea61c2f388aeaed699ffc750ea3f3b5 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 5 Mar 2015 16:49:21 +0000 Subject: [PATCH] Sensibly format rows with table name on the right. Rows were already too long to fit on a standard-width terminal, yet we were truncating names to fit in an arbitrary width. Instead put the table name on the right and let it fill all available space. Call ClearLine() after displaying each row so that displaying a shorter row when the display updates will not pollute the side of the screen. Make sure we don't try to draw lines too low down on the screen. --- app/app.go | 68 +++++++++++++++------- i_s/processlist/pl_by_user.go | 24 +++----- .../private.go | 25 +++----- .../private.go | 24 +++----- p_s/file_summary_by_instance/private.go | 23 +++----- p_s/table_io_waits_summary_by_table/private.go | 32 ++++------ p_s/table_lock_waits_summary_by_table/private.go | 33 +++++------ 7 files changed, 102 insertions(+), 127 deletions(-) diff --git a/app/app.go b/app/app.go index 3588133..45490f8 100644 --- a/app/app.go +++ b/app/app.go @@ -320,23 +320,27 @@ func (app *App) displayOpsOrLatency() { app.screen.BoldPrintAt(0, 2, app.tiwsbt.Headings()) max_rows := app.screen.Height() - 3 + last_row := app.screen.Height() - 1 row_content := app.tiwsbt.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows - for k := len(row_content); k < (app.screen.Height() - 3); k++ { + for k := len(row_content); k < max_rows; k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < max_rows - 1 { app.screen.PrintAt(0, y, app.tiwsbt.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.tiwsbt.TotalRowContent()) + total := app.tiwsbt.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } // show actual I/O latency values @@ -344,120 +348,140 @@ func (app App) displayIO() { app.screen.BoldPrintAt(0, 2, app.fsbi.Headings()) // print out the data - max_rows := app.screen.Height() - 3 + max_rows := app.screen.Height() - 4 + last_row := app.screen.Height() - 1 row_content := app.fsbi.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows - for k := len(row_content); k < (app.screen.Height() - 3); k++ { + for k := len(row_content); k < max_rows; k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < last_row { app.screen.PrintAt(0, y, app.fsbi.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.fsbi.TotalRowContent()) + total := app.fsbi.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } func (app *App) displayLocks() { app.screen.BoldPrintAt(0, 2, app.tlwsbt.Headings()) // print out the data - max_rows := app.screen.Height() - 3 + max_rows := app.screen.Height() - 4 + last_row := app.screen.Height() - 1 row_content := app.tlwsbt.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows for k := len(row_content); k < (app.screen.Height() - 3); k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < last_row { app.screen.PrintAt(0, y, app.tlwsbt.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.tlwsbt.TotalRowContent()) + total := app.tlwsbt.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } func (app *App) displayUsers() { app.screen.BoldPrintAt(0, 2, app.users.Headings()) // print out the data - max_rows := app.screen.Height() - 3 + max_rows := app.screen.Height() - 4 + last_row := app.screen.Height() - 1 row_content := app.users.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows - for k := len(row_content); k < (app.screen.Height() - 3); k++ { + for k := len(row_content); k < max_rows; k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < last_row { app.screen.PrintAt(0, y, app.users.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.users.TotalRowContent()) + total := app.users.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } func (app *App) displayMutex() { app.screen.BoldPrintAt(0, 2, app.ewsgben.Headings()) // print out the data - max_rows := app.screen.Height() - 3 + max_rows := app.screen.Height() - 4 + last_row := app.screen.Height() - 1 row_content := app.ewsgben.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows - for k := len(row_content); k < (app.screen.Height() - 3); k++ { + for k := len(row_content); k < max_rows; k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < last_row { app.screen.PrintAt(0, y, app.ewsgben.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.ewsgben.TotalRowContent()) + total := app.ewsgben.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } func (app *App) displayStages() { app.screen.BoldPrintAt(0, 2, app.essgben.Headings()) // print out the data - max_rows := app.screen.Height() - 3 + max_rows := app.screen.Height() - 4 + last_row := app.screen.Height() - 1 row_content := app.essgben.RowContent(max_rows) // print out rows for k := range row_content { y := 3 + k app.screen.PrintAt(0, y, row_content[k]) + app.screen.ClearLine(len(row_content[k]), y) } // print out empty rows - for k := len(row_content); k < (app.screen.Height() - 3); k++ { + for k := len(row_content); k < max_rows; k++ { y := 3 + k - if y < app.screen.Height()-1 { + if y < last_row { app.screen.PrintAt(0, y, app.essgben.EmptyRowContent()) } } // print out the totals at the bottom - app.screen.BoldPrintAt(0, app.screen.Height()-1, app.essgben.TotalRowContent()) + total := app.essgben.TotalRowContent() + app.screen.BoldPrintAt(0, last_row, total) + app.screen.ClearLine(len(total), last_row) } // do we want to show all p_s data? diff --git a/i_s/processlist/pl_by_user.go b/i_s/processlist/pl_by_user.go index 3100cc6..9edaa68 100644 --- a/i_s/processlist/pl_by_user.go +++ b/i_s/processlist/pl_by_user.go @@ -38,27 +38,18 @@ type pl_by_user_row struct { type pl_by_user_rows []pl_by_user_row /* -username |Run Time %age|Sleeping %|Conn Actv|Hosts DBs|Sel Ins Upd Del Oth| -xxxxxxxxxxxxxx|hh:mm:ss 100.0%|hh:mm:ss 100.0%|9999 9999|9999 999|999 999 999 999 999| +Run Time %age|Sleeping %|Conn Actv|Hosts DBs|Sel Ins Upd Del Oth|username +hh:mm:ss 100.0%|hh:mm:ss 100.0%|9999 9999|9999 999|999 999 999 999 999|xxxxxxxxxxxxxx */ func (r *pl_by_user_row) headings() string { - return fmt.Sprintf("%-14s|%-8s %6s|%-8s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|", - "User", "Run Time", "%", "Sleeping", "%", "Conn", "Actv", "Hosts", "DBs", "Sel", "Ins", "Upd", "Del", "Oth") + return fmt.Sprintf("%-8s %6s|%-8s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|%s", + "Run Time", "%", "Sleeping", "%", "Conn", "Actv", "Hosts", "DBs", "Sel", "Ins", "Upd", "Del", "Oth", "User") } // generate a printable result func (r *pl_by_user_row) row_content(totals pl_by_user_row) string { - var u string - if len(r.username) == 0 { - u = "" - } else if len(r.username) > 14 { - u = r.username[0:14] - } else { - u = r.username - } - return fmt.Sprintf("%-14s|%8s %6s|%8s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|", - u, + return fmt.Sprintf("%8s %6s|%8s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|%s", lib.FormatSeconds(r.runtime), lib.FormatPct(lib.MyDivide(r.runtime, totals.runtime)), lib.FormatSeconds(r.sleeptime), @@ -71,7 +62,8 @@ func (r *pl_by_user_row) row_content(totals pl_by_user_row) string { lib.FormatCounter(int(r.inserts), 3), lib.FormatCounter(int(r.updates), 3), lib.FormatCounter(int(r.deletes), 3), - lib.FormatCounter(int(r.other), 3)) + lib.FormatCounter(int(r.other), 3), + r.username) } // generate a row of totals from a table @@ -103,7 +95,7 @@ func (t pl_by_user_rows) Headings() string { // describe a whole row func (r pl_by_user_row) String() string { - return fmt.Sprintf("%v %v %v %v %v %v %v %v %v %v", r.username, r.runtime, r.connections, r.sleeptime, r.active, r.hosts, r.dbs, r.selects, r.inserts, r.updates, r.deletes, r.other) + return fmt.Sprintf("%v %v %v %v %v %v %v %v %v %v", r.runtime, r.connections, r.sleeptime, r.active, r.hosts, r.dbs, r.selects, r.inserts, r.updates, r.deletes, r.other, r.username) } // total time is runtime + sleeptime diff --git a/p_s/events_stages_summary_global_by_event_name/private.go b/p_s/events_stages_summary_global_by_event_name/private.go index 5c3c090..a1f417d 100644 --- a/p_s/events_stages_summary_global_by_event_name/private.go +++ b/p_s/events_stages_summary_global_by_event_name/private.go @@ -99,15 +99,6 @@ func (r *table_row) name() string { } } -// stage name limited to 40 characters -func (r *table_row) pretty_name() string { - s := r.name() - if len(s) > 40 { - s = s[:39] - } - return s -} - // add the values of one row to another one func (this *table_row) add(other table_row) { this.SUM_TIMER_WAIT += other.SUM_TIMER_WAIT @@ -162,29 +153,29 @@ func (this *table_rows) subtract(initial table_rows) { // stage headings func (r *table_row) headings() string { - return fmt.Sprintf("%-40s|%10s %6s %8s|", "Stage Name", "Latency", "%", "Counter") + return fmt.Sprintf("%10s %6s %8s|%s", "Latency", "%", "Counter", "Stage Name") } // generate a printable result func (r *table_row) row_content(totals table_row) string { - name := r.pretty_name() + name := r.name() if r.COUNT_STAR == 0 && name != "Totals" { name = "" } - return fmt.Sprintf("%-40s|%10s %6s %8s|", - name, + return fmt.Sprintf("%10s %6s %8s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT)), - lib.FormatAmount(r.COUNT_STAR)) + lib.FormatAmount(r.COUNT_STAR), + name) } // describe a whole row func (r table_row) String() string { - return fmt.Sprintf("%-40s %10s %10s", - r.pretty_name(), + return fmt.Sprintf("%10s %10s %s", lib.FormatTime(r.SUM_TIMER_WAIT), - lib.FormatAmount(r.COUNT_STAR)) + lib.FormatAmount(r.COUNT_STAR), + r.name()) } // describe a whole table diff --git a/p_s/events_waits_summary_global_by_event_name/private.go b/p_s/events_waits_summary_global_by_event_name/private.go index 523a20f..87419cc 100644 --- a/p_s/events_waits_summary_global_by_event_name/private.go +++ b/p_s/events_waits_summary_global_by_event_name/private.go @@ -33,30 +33,22 @@ func (r *table_row) name() string { return n } -func (r *table_row) pretty_name() string { - s := r.name() - if len(s) > 30 { - s = s[:29] - } - return s -} - func (r *table_row) headings() string { - return fmt.Sprintf("%-30s %10s %6s %6s", "Mutex Name", "Latency", "MtxCnt", "%") + return fmt.Sprintf("%10s %6s %6s %s", "Latency", "MtxCnt", "%", "Mutex Name") } // generate a printable result func (r *table_row) row_content(totals table_row) string { - name := r.pretty_name() + name := r.name() if r.COUNT_STAR == 0 && name != "Totals" { name = "" } - return fmt.Sprintf("%-30s|%10s %6s %6s", - name, + return fmt.Sprintf("%10s %6s %6s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatAmount(r.COUNT_STAR), - lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT))) + lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT)), + name) } func (this *table_row) add(other table_row) { @@ -161,10 +153,10 @@ func (t table_rows) needs_refresh(t2 table_rows) bool { // describe a whole row func (r table_row) String() string { - return fmt.Sprintf("%-30s|%10s %10s %10s %10s %10s|%10s %10s|%10s %10s %10s %10s %10s|%10s %10s", - r.pretty_name(), + return fmt.Sprintf("%10s %10s %10s %10s %10s|%10s %10s|%10s %10s %10s %10s %10s|%10s %10s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), - lib.FormatAmount(r.COUNT_STAR)) + lib.FormatAmount(r.COUNT_STAR), + r.name()) } // describe a whole table diff --git a/p_s/file_summary_by_instance/private.go b/p_s/file_summary_by_instance/private.go index 3c3b698..baa7c3b 100644 --- a/p_s/file_summary_by_instance/private.go +++ b/p_s/file_summary_by_instance/private.go @@ -97,18 +97,8 @@ func (r *table_row) name() string { return r.FILE_NAME } -// Return a formatted pretty name for the row. -func (r *table_row) pretty_name() string { - s := r.name() - if len(s) > 30 { - s = s[:29] - } - return s -} - func (r *table_row) headings() string { - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s|%8s %8s|%8s %6s %6s %6s", - "Table Name", + return fmt.Sprintf("%10s %6s|%6s %6s %6s|%8s %8s|%8s %6s %6s %6s|%s", "Latency", "%", "Read", @@ -119,12 +109,13 @@ func (r *table_row) headings() string { "Ops", "R Ops", "W Ops", - "M Ops") + "M Ops", + "Table Name") } // generate a printable result func (row *table_row) row_content(totals table_row) string { - var name string = row.pretty_name() + var name string = row.name() // We assume that if COUNT_STAR = 0 then there's no data at all... // when we have no data we really don't want to show the name either. @@ -132,8 +123,7 @@ func (row *table_row) row_content(totals table_row) string { name = "" } - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s|%8s %8s|%8s %6s %6s %6s", - name, + return fmt.Sprintf("%10s %6s|%6s %6s %6s|%8s %8s|%8s %6s %6s %6s|%s", lib.FormatTime(row.SUM_TIMER_WAIT), lib.FormatPct(lib.MyDivide(row.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(row.SUM_TIMER_READ, row.SUM_TIMER_WAIT)), @@ -144,7 +134,8 @@ func (row *table_row) row_content(totals table_row) string { lib.FormatAmount(row.COUNT_STAR), lib.FormatPct(lib.MyDivide(row.COUNT_READ, row.COUNT_STAR)), lib.FormatPct(lib.MyDivide(row.COUNT_WRITE, row.COUNT_STAR)), - lib.FormatPct(lib.MyDivide(row.COUNT_MISC, row.COUNT_STAR))) + lib.FormatPct(lib.MyDivide(row.COUNT_MISC, row.COUNT_STAR)), + name) } func (this *table_row) add(other table_row) { diff --git a/p_s/table_io_waits_summary_by_table/private.go b/p_s/table_io_waits_summary_by_table/private.go index 92195e1..6bfa6a9 100644 --- a/p_s/table_io_waits_summary_by_table/private.go +++ b/p_s/table_io_waits_summary_by_table/private.go @@ -57,55 +57,47 @@ func (r *table_row) name() string { return n } -func (r *table_row) pretty_name() string { - s := r.name() - if len(s) > 30 { - s = s[:29] - } - return s -} - func (r *table_row) latency_headings() string { - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s %6s", "Table Name", "Latency", "%", "Fetch", "Insert", "Update", "Delete") + return fmt.Sprintf("%10s %6s|%6s %6s %6s %6s|%s", "Latency", "%", "Fetch", "Insert", "Update", "Delete", "Table Name") } func (r *table_row) ops_headings() string { - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s %6s", "Table Name", "Ops", "%", "Fetch", "Insert", "Update", "Delete") + return fmt.Sprintf("%10s %6s|%6s %6s %6s %6s|%s", "Ops", "%", "Fetch", "Insert", "Update", "Delete", "Table Name") } // generate a printable result func (r *table_row) latency_row_content(totals table_row) string { // assume the data is empty so hide it. - name := r.pretty_name() + name := r.name() if r.COUNT_STAR == 0 && name != "Totals" { name = "" } - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s %6s", - name, + return fmt.Sprintf("%10s %6s|%6s %6s %6s %6s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_FETCH, r.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_INSERT, r.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_UPDATE, r.SUM_TIMER_WAIT)), - lib.FormatPct(lib.MyDivide(r.SUM_TIMER_DELETE, r.SUM_TIMER_WAIT))) + lib.FormatPct(lib.MyDivide(r.SUM_TIMER_DELETE, r.SUM_TIMER_WAIT)), + name) } // generate a printable result for ops func (r *table_row) ops_row_content(totals table_row) string { // assume the data is empty so hide it. - name := r.pretty_name() + name := r.name() if r.COUNT_STAR == 0 && name != "Totals" { name = "" } - return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s %6s", - name, + return fmt.Sprintf("%10s %6s|%6s %6s %6s %6s|%s", lib.FormatAmount(r.COUNT_STAR), lib.FormatPct(lib.MyDivide(r.COUNT_STAR, totals.COUNT_STAR)), lib.FormatPct(lib.MyDivide(r.COUNT_FETCH, r.COUNT_STAR)), lib.FormatPct(lib.MyDivide(r.COUNT_INSERT, r.COUNT_STAR)), lib.FormatPct(lib.MyDivide(r.COUNT_UPDATE, r.COUNT_STAR)), - lib.FormatPct(lib.MyDivide(r.COUNT_DELETE, r.COUNT_STAR))) + lib.FormatPct(lib.MyDivide(r.COUNT_DELETE, r.COUNT_STAR)), + name) } func (this *table_row) add(other table_row) { @@ -269,8 +261,8 @@ func (t table_rows) needs_refresh(t2 table_rows) bool { // describe a whole row func (r table_row) String() string { - return fmt.Sprintf("%-30s|%10s %10s %10s %10s %10s|%10s %10s|%10s %10s %10s %10s %10s|%10s %10s", - r.pretty_name(), + return fmt.Sprintf("%s|%10s %10s %10s %10s %10s|%10s %10s|%10s %10s %10s %10s %10s|%10s %10s", + r.name(), lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatTime(r.SUM_TIMER_FETCH), lib.FormatTime(r.SUM_TIMER_INSERT), diff --git a/p_s/table_lock_waits_summary_by_table/private.go b/p_s/table_lock_waits_summary_by_table/private.go index 2f8ed67..3e2eed6 100644 --- a/p_s/table_lock_waits_summary_by_table/private.go +++ b/p_s/table_lock_waits_summary_by_table/private.go @@ -135,35 +135,27 @@ func (r *table_row) name() string { return n } -func (r *table_row) pretty_name() string { - s := r.name() - if len(s) > 30 { - s = s[:29] - } - return s -} - -// Table Name Latency %| Read Write|S.Lock High NoIns Normal Extrnl|AlloWr CncIns WrtDly Low Normal Extrnl| -// xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1234567890 100.0%|xxxxx% xxxxx%|xxxxx% xxxxx% xxxxx% xxxxx% xxxxx%|xxxxx% xxxxx% xxxxx% xxxxx% xxxxx% xxxxx%| +// Latency %| Read Write|S.Lock High NoIns Normal Extrnl|AlloWr CncIns WrtDly Low Normal Extrnl| +// 1234567 100.0%|xxxxx% xxxxx%|xxxxx% xxxxx% xxxxx% xxxxx% xxxxx%|xxxxx% xxxxx% xxxxx% xxxxx% xxxxx% xxxxx%|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx func (r *table_row) headings() string { - return fmt.Sprintf("%-30s %10s %6s|%6s %6s|%6s %6s %6s %6s %6s|%6s %6s %6s %6s %6s", - "Table Name", "Latency", "%", + return fmt.Sprintf("%10s %6s|%6s %6s|%6s %6s %6s %6s %6s|%6s %6s %6s %6s %6s|%-30s", + "Latency", "%", "Read", "Write", "S.Lock", "High", "NoIns", "Normal", "Extrnl", - "AlloWr", "CncIns", "Low", "Normal", "Extrnl") + "AlloWr", "CncIns", "Low", "Normal", "Extrnl", + "Table Name") } // generate a printable result func (r *table_row) row_content(totals table_row) string { // assume the data is empty so hide it. - name := r.pretty_name() + name := r.name() if r.COUNT_STAR == 0 && name != "Totals" { name = "" } - return fmt.Sprintf("%-30s %10s %6s|%6s %6s|%6s %6s %6s %6s %6s|%6s %6s %6s %6s %6s", - name, + return fmt.Sprintf("%10s %6s|%6s %6s|%6s %6s %6s %6s %6s|%6s %6s %6s %6s %6s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WAIT, totals.SUM_TIMER_WAIT)), @@ -180,7 +172,8 @@ func (r *table_row) row_content(totals table_row) string { lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WRITE_CONCURRENT_INSERT, r.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WRITE_LOW_PRIORITY, r.SUM_TIMER_WAIT)), lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WRITE_NORMAL, r.SUM_TIMER_WAIT)), - lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WRITE_EXTERNAL, r.SUM_TIMER_WAIT))) + lib.FormatPct(lib.MyDivide(r.SUM_TIMER_WRITE_EXTERNAL, r.SUM_TIMER_WAIT)), + name) } func (this *table_row) add(other table_row) { @@ -318,8 +311,7 @@ func (t table_rows) needs_refresh(t2 table_rows) bool { // describe a whole row func (r table_row) String() string { - return fmt.Sprintf("%-30s|%10s %10s %10s|%10s %10s %10s %10s %10s|%10s %10s %10s %10s %10s", - r.pretty_name(), + return fmt.Sprintf("%10s %10s %10s|%10s %10s %10s %10s %10s|%10s %10s %10s %10s %10s|%s", lib.FormatTime(r.SUM_TIMER_WAIT), lib.FormatTime(r.SUM_TIMER_READ), lib.FormatTime(r.SUM_TIMER_WRITE), @@ -334,7 +326,8 @@ func (r table_row) String() string { lib.FormatTime(r.SUM_TIMER_WRITE_CONCURRENT_INSERT), lib.FormatTime(r.SUM_TIMER_WRITE_LOW_PRIORITY), lib.FormatTime(r.SUM_TIMER_WRITE_NORMAL), - lib.FormatTime(r.SUM_TIMER_WRITE_EXTERNAL)) + lib.FormatTime(r.SUM_TIMER_WRITE_EXTERNAL), + r.name()) } // describe a whole table -- 2.7.4