code: func (ct *costTracker) updateStats(code, amount, servingTime, realCost uint64) {
  	avg := reqAvgTimeCost[code]
  	avgTime := avg.baseCost + amount*avg.reqCost
  	select {
  	case ct.gfUpdateCh <- gfUpdate{float64(avgTime), float64(servingTime)}:
  	default:
  	}
  	if makeCostStats {
  		realCost <<= 4
  		l := 0
  		for l < 9 && realCost > avgTime {
  			l++
  			realCost >>= 1
  		}
  		atomic.AddUint64(&ct.stats[code][l], 1)
  	}
  }
docs: // updateStats updates the global cost factor and (if enabled) the real cost vs.
  // average estimate statistics