mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 08:04:01 +03:00
Stats management utilities
This commit is contained in:
+7
-4
@@ -13,12 +13,15 @@ var instance *stats
|
||||
|
||||
func Start(conf *config.Config) {
|
||||
instance = &stats{
|
||||
URLs: conf.GetURLs(),
|
||||
Uptime: uptime(time.Now()),
|
||||
speedCurrent: &speed{},
|
||||
mutex: &sync.RWMutex{},
|
||||
URLs: conf.GetURLs(),
|
||||
Uptime: uptime(time.Now()),
|
||||
mutex: &sync.RWMutex{},
|
||||
}
|
||||
|
||||
go crashManager()
|
||||
go connectionManager()
|
||||
go trafficManager()
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user