diff options
Diffstat (limited to 'daemon/daemon.go')
-rw-r--r-- | daemon/daemon.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go index f100159..e885289 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -8,6 +8,7 @@ import ( "context" "os" "os/signal" + "runtime" "syscall" "time" @@ -27,6 +28,16 @@ func Run(cfg *config.Config, store *storage.Storage) { signal.Notify(stop, os.Interrupt) signal.Notify(stop, syscall.SIGTERM) + go func() { + for { + var m runtime.MemStats + runtime.ReadMemStats(&m) + logger.Debug("Alloc=%vK, TotalAlloc=%vK, Sys=%vK, NumGC=%v, GoRoutines=%d, NumCPU=%d", + m.Alloc/1024, m.TotalAlloc/1024, m.Sys/1024, m.NumGC, runtime.NumGoroutine(), runtime.NumCPU()) + time.Sleep(30 * time.Second) + } + }() + translator := locale.Load() feedHandler := feed.NewFeedHandler(store, translator) pool := scheduler.NewWorkerPool(feedHandler, cfg.WorkerPoolSize()) |