code: func (r *reporter) run() {
  	// signal that the reporter loop is done
  	defer close(r.done)
  
  	intervalTicker := time.NewTicker(r.interval)
  
  	for {
  		select {
  		case <-intervalTicker.C:
  			//at each tick send the metrics
  			if err := r.save(); err != nil {
  				log.Error("unable to send metrics to LevelDB", "err", err)
  				//If there is an error in writing, exit the routine; we assume here that the error is
  				//severe and don't attempt to write again.
  				//Also, this should prevent leaking when the node is stopped
  				return
  			}
  		case <-r.quit:
  			//graceful shutdown
  			if err := r.save(); err != nil {
  				log.Error("unable to send metrics to LevelDB", "err", err)
  			}
  			return
  		}
  	}
  }
docs: //run is the goroutine which periodically sends the metrics to the configured LevelDB