Browse Source

增加监控

renzheng 7 years ago
parent
commit
11d992f635
3 changed files with 7 additions and 2 deletions
  1. 5 0
      src/saveServer/README.md
  2. 2 2
      src/saveServer/datamonitor.go
  3. BIN
      src/saveServer/saveServer

+ 5 - 0
src/saveServer/README.md

@@ -0,0 +1,5 @@
+config.json
+	port 配置项目是提供网页端保存、日志开启服务,节点切换时注意端口冲突
+
+dev2.0.1分支
+1、增加数据监控

+ 2 - 2
src/saveServer/datamonitor.go

@@ -1,9 +1,9 @@
 package main
 package main
 
 
 import (
 import (
+	"saveServer/tools"
 	"sync"
 	"sync"
 	"time"
 	"time"
-	"tools"
 )
 )
 
 
 type InfoStatus struct {
 type InfoStatus struct {
@@ -45,9 +45,9 @@ func (is *InfoStatus) Save() {
 		save["starttime"] = is.Starttime
 		save["starttime"] = is.Starttime
 		save["endtime"] = is.Endtime
 		save["endtime"] = is.Endtime
 		save["flag"] = "saveser"
 		save["flag"] = "saveser"
-		is.Val = map[int]int{}
 		go tools.Mgo.Save("datamonitor", save)
 		go tools.Mgo.Save("datamonitor", save)
 	}
 	}
+	is.Val = map[int]int{}
 	is.Starttime = is.Endtime
 	is.Starttime = is.Endtime
 	is.Lock.Unlock()
 	is.Lock.Unlock()
 	time.AfterFunc(15*time.Minute, is.Save)
 	time.AfterFunc(15*time.Minute, is.Save)

BIN
src/saveServer/saveServer