2016-02-19 10:13:30 +00:00
|
|
|
package main
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Announced struct {
|
|
|
|
NodeServer *NodeServer
|
|
|
|
nodes *Nodes
|
|
|
|
outputFile string
|
|
|
|
collectInterval time.Duration
|
|
|
|
saveInterval time.Duration
|
|
|
|
collectors []*Collector
|
|
|
|
}
|
|
|
|
|
2016-02-19 10:30:42 +00:00
|
|
|
func NewAnnounced(ns *NodeServer) *Announced {
|
2016-02-19 10:13:30 +00:00
|
|
|
collects := []*Collector{
|
|
|
|
NewCollector("statistics"),
|
|
|
|
NewCollector("nodeinfo"),
|
|
|
|
NewCollector("neighbours"),
|
|
|
|
}
|
|
|
|
return &Announced{
|
|
|
|
ns,
|
|
|
|
NewNodes(),
|
2016-02-19 10:30:42 +00:00
|
|
|
"webroot/nodes.json",
|
2016-02-19 10:13:30 +00:00
|
|
|
time.Second * time.Duration(15),
|
|
|
|
time.Second * time.Duration(15),
|
|
|
|
collects,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (announced *Announced) Run() {
|
|
|
|
|
|
|
|
}
|