disable es log

This commit is contained in:
Jay 2018-10-27 21:39:31 +08:00
parent 23644f3e16
commit aa56297a9c

23
main.go
View File

@ -14,7 +14,6 @@ import (
"git.trj.tw/golang/mtfosbot/module/apis/twitch" "git.trj.tw/golang/mtfosbot/module/apis/twitch"
"git.trj.tw/golang/mtfosbot/module/cmd" "git.trj.tw/golang/mtfosbot/module/cmd"
"git.trj.tw/golang/mtfosbot/module/es"
"git.trj.tw/golang/mtfosbot/module/options" "git.trj.tw/golang/mtfosbot/module/options"
"git.trj.tw/golang/mtfosbot/module/utils" "git.trj.tw/golang/mtfosbot/module/utils"
@ -46,11 +45,6 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
err = es.NewClient()
if err != nil {
log.Fatal(err)
}
// connect to database // connect to database
db, err := model.NewDB() db, err := model.NewDB()
if err != nil { if err != nil {
@ -108,23 +102,6 @@ func PrintMemUsage() {
// fmt.Printf("HeapAlloc = %v MiB", bToMb(m.HeapAlloc)) // fmt.Printf("HeapAlloc = %v MiB", bToMb(m.HeapAlloc))
// fmt.Printf("\t HeapSys = %v MiB", bToMb(m.HeapSys)) // fmt.Printf("\t HeapSys = %v MiB", bToMb(m.HeapSys))
// fmt.Printf("\t NextGC = %v MiB\n", bToMb(m.NextGC)) // fmt.Printf("\t NextGC = %v MiB\n", bToMb(m.NextGC))
obj := map[string]interface{}{
"Alloc": m.Alloc,
"Sys": m.Sys,
"HeapAlloc": m.HeapAlloc,
"HeapSys": m.HeapSys,
"HeapIdle": m.HeapIdle,
"HeapInuse": m.HeapInuse,
"HeapReleased": m.HeapReleased,
"StackInuse": m.StackInuse,
"StackSys": m.StackSys,
"GCSys": m.GCSys,
"NextGC": m.NextGC,
"NumGC": m.NumGC,
}
es.PutLog("memory", obj)
} }
func bToMb(b uint64) uint64 { func bToMb(b uint64) uint64 {
return b / 1024 / 1024 return b / 1024 / 1024