timetable-extension #1

Open
fred.boniface wants to merge 160 commits from timetable-extension into main
Showing only changes of commit f243fc6831 - Show all commits

View File

@ -50,7 +50,17 @@ func goroutineTicker(stop <-chan struct{}) {
case <-stop: case <-stop:
return return
case <-ticker.C: case <-ticker.C:
fmt.Printf("Number of goroutines running: %d\n", runtime.NumGoroutine()) debugLog()
} }
} }
} }
func debugLog() {
var memStats runtime.MemStats
runtime.ReadMemStats(&memStats)
goroutines := runtime.NumGoroutine()
fmt.Printf("\nNumber of goroutines: %d\n", goroutines)
fmt.Printf("Heap Allocated memory: %2f MB\n\n", float64(memStats.HeapAlloc)/(1024*1024))
}