grim/youtrack-import

Handle comments that end up with no text after processing. This typically happens if it was a reply with the body removed
package mem
import (
"fmt"
"runtime"
)
func PrintMemUsage() {
fmt.Printf("%s\n", MemUsage())
}
func MemUsage() string {
var m runtime.MemStats
runtime.ReadMemStats(&m)
var s string
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
s += fmt.Sprintf("Alloc = %v MiB", bToMb(m.Alloc))
s += fmt.Sprintf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc))
s += fmt.Sprintf("\tSys = %v MiB", bToMb(m.Sys))
s += fmt.Sprintf("\tNumGC = %v\n", m.NumGC)
return s
}
func bToMb(b uint64) uint64 {
return b / 1024 / 1024
}