)
const (
- myname = "pstop"
+ myname = "pstop"
copyright = "Copyright (C) 2014 Simon J Mudd <sjmudd@pobox.com>"
)
// sec_to_time() converts a number of hours, minutes and seconds into hh:mm:ss format.
// e.g. 7384 = 2h 3m 4s, 7200 + 180 + 4
-func sec_to_time(d int) string {
+func sec_to_time(d uint64) string {
hours := d / 3600 // integer value
minutes := (d - hours*3600) / 60 // integer value
seconds := d - hours*3600 - minutes*60
return fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)
}
-// FormatTime is based on sys.format_time. It
+// FormatTime is based on sys.format_time. It
// formats to 10 characters including space and suffix.
// All values have 2 decimal places. Zero is returned as
// an empty string.
-func FormatTime(picoseconds int) string {
+func FormatTime(picoseconds uint64) string {
if picoseconds == 0 {
return ""
}
// For values = 0 return an empty string.
// For values < 1000 show 6,2 decimal places.
// For values >= 1000 show 6,1 decimal place.
-func FormatAmount(amount int) string {
+func FormatAmount(amount uint64) string {
var suffix string
var formatted string
var decimal_amount float64
return ""
}
if amount <= 1024 {
- return strconv.Itoa(amount)
+ return strconv.Itoa(int(amount))
}
if amount > (1024 * 1024 * 1024 * 1024) {
}
// MyDivide() divides a by b except if b is 0 in which case we return 0.
-func MyDivide(a int, b int) float64 {
+func MyDivide(a uint64, b uint64) float64 {
if b == 0 {
return float64(0)
} else {
OBJECT_SCHEMA string // in theory redundant but keep anyway
OBJECT_NAME string // in theory redundant but keep anyway
- SUM_TIMER_WAIT int
- SUM_TIMER_READ int
- SUM_TIMER_WRITE int
- SUM_TIMER_FETCH int
- SUM_TIMER_INSERT int
- SUM_TIMER_UPDATE int
- SUM_TIMER_DELETE int
-
- COUNT_STAR int
- COUNT_READ int
- COUNT_WRITE int
- COUNT_FETCH int
- COUNT_INSERT int
- COUNT_UPDATE int
- COUNT_DELETE int
+ SUM_TIMER_WAIT uint64
+ SUM_TIMER_READ uint64
+ SUM_TIMER_WRITE uint64
+ SUM_TIMER_FETCH uint64
+ SUM_TIMER_INSERT uint64
+ SUM_TIMER_UPDATE uint64
+ SUM_TIMER_DELETE uint64
+
+ COUNT_STAR uint64
+ COUNT_READ uint64
+ COUNT_WRITE uint64
+ COUNT_FETCH uint64
+ COUNT_INSERT uint64
+ COUNT_UPDATE uint64
+ COUNT_DELETE uint64
}
type table_io_waits_summary_by_table_rows []table_io_waits_summary_by_table_row
OBJECT_NAME string // in theory redundant but keep anyway
COUNT_STAR int
- SUM_TIMER_WAIT int
- SUM_TIMER_READ int
- SUM_TIMER_WRITE int
-
- SUM_TIMER_READ_WITH_SHARED_LOCKS int
- SUM_TIMER_READ_HIGH_PRIORITY int
- SUM_TIMER_READ_NO_INSERT int
- SUM_TIMER_READ_NORMAL int
- SUM_TIMER_READ_EXTERNAL int
-
- SUM_TIMER_WRITE_ALLOW_WRITE int
- SUM_TIMER_WRITE_CONCURRENT_INSERT int
- SUM_TIMER_WRITE_LOW_PRIORITY int
- SUM_TIMER_WRITE_NORMAL int
- SUM_TIMER_WRITE_EXTERNAL int
+ SUM_TIMER_WAIT uint64
+ SUM_TIMER_READ uint64
+ SUM_TIMER_WRITE uint64
+
+ SUM_TIMER_READ_WITH_SHARED_LOCKS uint64
+ SUM_TIMER_READ_HIGH_PRIORITY uint64
+ SUM_TIMER_READ_NO_INSERT uint64
+ SUM_TIMER_READ_NORMAL uint64
+ SUM_TIMER_READ_EXTERNAL uint64
+
+ SUM_TIMER_WRITE_ALLOW_WRITE uint64
+ SUM_TIMER_WRITE_CONCURRENT_INSERT uint64
+ SUM_TIMER_WRITE_LOW_PRIORITY uint64
+ SUM_TIMER_WRITE_NORMAL uint64
+ SUM_TIMER_WRITE_EXTERNAL uint64
}
type table_lock_waits_summary_by_table_rows []table_lock_waits_summary_by_table_row