Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

init.go 576B

12345678910111213141516171819202122232425262728
  1. package stats
  2. import (
  3. "github.com/juju/errors"
  4. "github.com/9seconds/mtg/config"
  5. )
  6. // Init initializes stats subsystem.
  7. func Init(conf *config.Config) error {
  8. if conf.StatsD.Enabled {
  9. client, err := newStatsd(conf)
  10. if err != nil {
  11. return errors.Annotate(err, "Cannot initialize statsd client")
  12. }
  13. go client.run()
  14. }
  15. prometheus, err := newPrometheus(conf)
  16. if err != nil {
  17. return errors.Annotate(err, "Cannot initialize prometheus client")
  18. }
  19. go prometheus.run()
  20. go NewStats(conf).start()
  21. go startServer(conf, prometheus.getHTTPHandler())
  22. return nil
  23. }