From 862415f6ba294ad678e3dd0e66695d7594f856ae Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@iotlink.com> Date: 星期二, 22 十月 2019 16:52:12 +0800 Subject: [PATCH] feat: add system summary information api --- main.go | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 21f6665..425e46d 100644 --- a/main.go +++ b/main.go @@ -1,14 +1,16 @@ package main import ( - "basic.com/dbapi.git" - "basic.com/valib/logger.git" "flag" - "github.com/spf13/viper" "strconv" "webserver/cache" "webserver/extend/config" + "webserver/extend/sys" "webserver/router" + + "basic.com/dbapi.git" + "basic.com/valib/logger.git" + "github.com/spf13/viper" ) var envirment = flag.String("e", "dev", "") @@ -40,7 +42,7 @@ viper.GetInt("LogLevel") >= logger.PanicLevel && viper.GetInt("LogLevel") <= logger.DebugLevel { logger.Config(logFile, viper.GetInt("LogLevel")) - }else{ + } else { logger.Config(logFile, logger.DebugLevel) } logger.SetSaveDays(logSaveDays) @@ -56,8 +58,11 @@ // @BasePath / func main() { flag.Parse() - go cache.Init(initchan, *dbIp, *surveyPort,*pubPort) - logger.Debug("heartBeat with db done!",<-initchan) + go cache.Init(initchan, *dbIp, *surveyPort, *pubPort) + logger.Debug("heartBeat with db done!", <-initchan) + + // 缁熻绯荤粺杩愯鐘舵�� + go sys.GatherStat() r := router.NewRouter() r.Run("0.0.0.0:8000") -- Gitblit v1.8.0