remove not use function and func
update submodule
This commit is contained in:
@@ -7,10 +7,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.trj.tw/golang/mtfosbot/module/apis/twitch"
|
||||
"git.trj.tw/golang/mtfosbot/module/cmd"
|
||||
@@ -80,33 +78,9 @@ func main() {
|
||||
log.Fatal(errors.New("log image root not exists"))
|
||||
}
|
||||
|
||||
go func() {
|
||||
for {
|
||||
PrintMemUsage()
|
||||
time.Sleep(time.Second * 20)
|
||||
}
|
||||
}()
|
||||
|
||||
server.Run(strings.Join([]string{":", strconv.Itoa(config.GetConf().Port)}, ""))
|
||||
}
|
||||
|
||||
// PrintMemUsage -
|
||||
func PrintMemUsage() {
|
||||
var m runtime.MemStats
|
||||
runtime.ReadMemStats(&m)
|
||||
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
|
||||
// fmt.Printf("Alloc = %v MiB", bToMb(m.Alloc))
|
||||
// fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc))
|
||||
// fmt.Printf("\tSys = %v MiB", bToMb(m.Sys))
|
||||
// fmt.Printf("\tNumGC = %v\n", m.NumGC)
|
||||
// fmt.Printf("HeapAlloc = %v MiB", bToMb(m.HeapAlloc))
|
||||
// fmt.Printf("\t HeapSys = %v MiB", bToMb(m.HeapSys))
|
||||
// fmt.Printf("\t NextGC = %v MiB\n", bToMb(m.NextGC))
|
||||
}
|
||||
func bToMb(b uint64) uint64 {
|
||||
return b / 1024 / 1024
|
||||
}
|
||||
|
||||
func registerTypes() {
|
||||
gob.Register(model.Account{})
|
||||
gob.Register(model.Commands{})
|
||||
|
||||
+1
-1
Submodule schema updated: 899a2fb0f2...bda0992957
Reference in New Issue
Block a user