Working server with 5s stats snapshots

This commit is contained in:
2015-10-28 01:23:39 +03:00
parent 3c77fec5e3
commit bd345af332
4 changed files with 66 additions and 61 deletions
+6 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/localhots/satan"
"github.com/localhots/satan/example/daemons"
"github.com/localhots/satan/example/kafka"
"github.com/localhots/satan/server"
"github.com/localhots/satan/stats"
)
@@ -24,9 +25,13 @@ func main() {
statsLogger := stats.NewStdoutLogger(0)
defer statsLogger.Print()
statsServer := stats.NewServer()
server := server.New(6464, statsServer)
server.Start()
s := satan.Summon()
s.SubscribeFunc = kafka.Subscribe
s.DaemonStats = statsLogger
s.DaemonStats = stats.NewGroup(statsLogger, statsServer)
s.AddDaemon(&daemons.NumberPrinter{})
s.AddDaemon(&daemons.PriceConsumer{})