Commit 55e582f4 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Implement PrintMap() centrally.

parent 83ba0346
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"log" "log"
"math" "math"
"regexp" "regexp"
"sort"
"syscall" "syscall"
"unsafe" "unsafe"
"io/ioutil" "io/ioutil"
...@@ -307,3 +308,22 @@ func CheckSuccess(e os.Error) { ...@@ -307,3 +308,22 @@ func CheckSuccess(e os.Error) {
} }
} }
// For printing latency data.
func PrintMap(m map[string]float64) {
keys := make([]string, len(m))
for k, _ := range m {
keys = append(keys, k)
}
sort.SortStrings(keys)
for _, k := range keys {
if m[k] > 0 {
fmt.Println(k, m[k])
}
}
}
func MyPID() string {
v, _ := os.Readlink("/proc/self")
return v
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment