func (r *pl_by_user_row) headings() string {
return fmt.Sprintf("%-14s|%10s %6s|%4s %4s|%5s %3s|%6s %6s %6s %6s %6s|",
- "username", "Run Time", "%", "Conn", "Actv", "Hosts", "DBs", "Select", "Insert", "Update", "Delete", "Other")
+ "User", "Run Time", "%", "Conn", "Actv", "Hosts", "DBs", "Select", "Insert", "Update", "Delete", "Other")
}
// generate a printable result
// generate a row of totals from a table
func (t pl_by_user_rows) totals() pl_by_user_row {
var totals pl_by_user_row
- totals.username = "TOTALS"
+ totals.username = "Totals"
for i := range t {
totals.runtime += t[i].runtime
func (t ByRunTime) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
func (t ByRunTime) Less(i, j int) bool {
return (t[i].runtime > t[j].runtime) ||
- ((t[i].runtime == t[j].runtime) && (t[i].connections > t[j].connections))
+ ((t[i].runtime == t[j].runtime) && (t[i].connections > t[j].connections)) ||
+ ((t[i].runtime == t[j].runtime) && (t[i].connections == t[j].connections) && (t[i].username < t[j].username))
}
func (t pl_by_user_rows) Sort() {
sort.Sort(ByRunTime(t))
}
-func (r pl_by_user_row) Description() string {
- return "no description"
-}
-
func (t pl_by_user_rows) emptyRowContent() string {
var r pl_by_user_row
return r.row_content(r)