stats/stats.go
func Start(ctx log.Interface, interval time.Duration) {
	ctx.WithField("interval", interval).Debug("starting stats loop")
	go func() {
		memstats := new(runtime.MemStats)
		for range time.Tick(interval) {
			runtime.ReadMemStats(memstats)
			ctx.WithFields(log.Fields{
				"goroutines": runtime.NumGoroutine(),
				"memory":     float64(memstats.Alloc) / megaByte, // MegaBytes allocated and not yet freed
			}).Debugf("memory stats")
		}
	}()
}
func Start(ctx log.Interface, interval time.Duration) {
	ctx.WithField("interval", interval).Debug("starting stats loop")
	go func() {
		memstats := new(runtime.MemStats)
		for range time.Tick(interval) {
			runtime.ReadMemStats(memstats)
			ctx.WithFields(log.Fields{
				"goroutines": runtime.NumGoroutine(),
				"memory":     float64(memstats.Alloc) / megaByte, // MegaBytes allocated and not yet freed
			}).Debugf("memory stats")
		}
	}()
}
// Start starts the stat process that will log relevant memory-related stats
// to ctx, at an interval determined by interval.