init
This commit is contained in:
parent
b74a2480cd
commit
43a9b30fd2
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,3 +22,5 @@ _testmain.go
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
|
||||
webroot/nodes.json
|
||||
|
@ -113,6 +113,8 @@ func (coll *Collector) parse(res *Response) {
|
||||
elem := reflect.ValueOf(node).Elem()
|
||||
field := elem.FieldByName(strings.Title(coll.collectType))
|
||||
field.Set(reflect.ValueOf(result))
|
||||
|
||||
nodeserver.SendAll(node)
|
||||
}
|
||||
|
||||
func (coll *Collector) receiver() {
|
||||
|
2
main.go
2
main.go
@ -16,7 +16,7 @@ var (
|
||||
func main(){
|
||||
var collectSeconds, saveSeconds int
|
||||
|
||||
flag.StringVar(&outputFile, "output", "nodes.json", "path output file")
|
||||
flag.StringVar(&outputFile, "output", "webroot/nodes.json", "path output file")
|
||||
flag.IntVar(&collectSeconds, "collectInterval", 15, "interval for data collections")
|
||||
flag.IntVar(&saveSeconds, "saveInterval", 5, "interval for data saving")
|
||||
flag.Parse()
|
||||
|
Loading…
Reference in New Issue
Block a user