code: func mergeStats(a, b []*pb.InstructionStat) (ret []*pb.InstructionStat) {
  	var nonOverlapping []*pb.InstructionStat
  	for _, ai := range a {
  		var found bool
  		for _, bi := range b {
  			if ai.StepId == bi.StepId {
  				found = true
  				if ai.InputCounter > bi.InputCounter {
  					ret = append(ret, ai)
  				} else {
  					ret = append(ret, bi)
  				}
  			}
  		}
  		if !found {
  			nonOverlapping = append(nonOverlapping, ai)
  		}
  	}
  	for _, bi := range b {
  		var found bool
  		for _, ai := range a {
  			if ai.StepId == bi.StepId {
  				found = true
  			}
  		}
  		if !found {
  			nonOverlapping = append(nonOverlapping, bi)
  		}
  	}
  	ret = append(ret, nonOverlapping...)
  	return ret
  }
docs: // merge existing stats with incoming stats