remove not use function and func
update submodule
This commit is contained in:
parent
75105e4cf7
commit
c44547573a
26
main.go
26
main.go
@ -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{})
|
||||
|
2
schema
2
schema
@ -1 +1 @@
|
||||
Subproject commit 899a2fb0f252bbb1e784e00805a2bef7545f9316
|
||||
Subproject commit bda09929578505cd4712856bee125b9838643d78
|
Loading…
Reference in New Issue
Block a user