mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 00:54:01 +03:00
Direct proxy works
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package stats
|
||||
|
||||
import (
|
||||
"github.com/juju/errors"
|
||||
|
||||
"github.com/9seconds/mtg/config"
|
||||
)
|
||||
|
||||
// Init initializes stats subsystem.
|
||||
func Init(conf *config.Config) error {
|
||||
if conf.StatsD.Enabled {
|
||||
client, err := newStatsd(conf)
|
||||
if err != nil {
|
||||
return errors.Annotate(err, "Cannot initialize statsd client")
|
||||
}
|
||||
go client.run()
|
||||
}
|
||||
prometheus, err := newPrometheus(conf)
|
||||
if err != nil {
|
||||
return errors.Annotate(err, "Cannot initialize prometheus client")
|
||||
}
|
||||
go prometheus.run()
|
||||
|
||||
go NewStats(conf).start()
|
||||
go startServer(conf, prometheus.getHTTPHandler())
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user