Working server with 5s stats snapshots
This commit is contained in:
+6
-1
@@ -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{})
|
||||
|
||||
Reference in New Issue
Block a user