git://git.iain.cx/iain
/
pstop.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add more command line docs + other cleanups
[pstop.git]
/
i_s
/
pl_by_user.go
diff --git
a/i_s/pl_by_user.go
b/i_s/pl_by_user.go
index
cd7bf9c
..
f5bd83f
100644
(file)
--- a/
i_s/pl_by_user.go
+++ b/
i_s/pl_by_user.go
@@
-43,7
+43,7
@@
xxxxxxxxxxxxxx|hh:mm:ss 100.0%|9999 9999|9999 999|100.0% 100.0% 100.0% 100.0% 1
func (r *pl_by_user_row) headings() string {
return fmt.Sprintf("%-14s|%10s %6s|%4s %4s|%5s %3s|%6s %6s %6s %6s %6s|",
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 printable result
@@
-74,7
+74,7
@@
func (r *pl_by_user_row) row_content(totals pl_by_user_row) string {
// 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
// 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 = "T
OTALS
"
+ totals.username = "T
otals
"
for i := range t {
totals.runtime += t[i].runtime
for i := range t {
totals.runtime += t[i].runtime
@@
-118,17
+118,14
@@
func (t ByRunTime) Len() int { return len(t) }
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) ||
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 (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)
func (t pl_by_user_rows) emptyRowContent() string {
var r pl_by_user_row
return r.row_content(r)