X-Git-Url: http://git.iain.cx/?p=pstop.git;a=blobdiff_plain;f=p_s%2Ffile_summary_by_instance%2Ffile_summary_by_instance_row.go;h=2050c61547220b6e4a61e86c7bf49db47d887897;hp=711b7428ed812959fe97c8ce2f6f14ff61307fe9;hb=99e8324ae6cc0c84dd9ced4486b4d7b6c049790c;hpb=6cd1819c4e354d974794363d71d10a9902ab627e diff --git a/p_s/file_summary_by_instance/file_summary_by_instance_row.go b/p_s/file_summary_by_instance/file_summary_by_instance_row.go index 711b742..2050c61 100644 --- a/p_s/file_summary_by_instance/file_summary_by_instance_row.go +++ b/p_s/file_summary_by_instance/file_summary_by_instance_row.go @@ -103,7 +103,7 @@ func (r *file_summary_by_instance_row) pretty_name() string { if len(s) > 30 { s = s[:29] } - return fmt.Sprintf("%-30s", s) + return s } func (r *file_summary_by_instance_row) headings() string { @@ -124,14 +124,12 @@ func (r *file_summary_by_instance_row) headings() string { // generate a printable result func (row *file_summary_by_instance_row) row_content(totals file_summary_by_instance_row) string { - var name string + var name string = row.pretty_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. - if row.COUNT_STAR == 0 { + if row.COUNT_STAR == 0 && name != "Totals" { name = "" - } else { - name = row.pretty_name() } return fmt.Sprintf("%-30s %10s %6s|%6s %6s %6s|%8s %8s|%8s %6s %6s %6s", @@ -182,7 +180,7 @@ func (this *file_summary_by_instance_row) subtract(other file_summary_by_instanc // return the totals of a slice of rows func (t file_summary_by_instance_rows) totals() file_summary_by_instance_row { var totals file_summary_by_instance_row - totals.FILE_NAME = "TOTALS" + totals.FILE_NAME = "Totals" for i := range t { totals.add(t[i])