code: func getBuilderHistories(c context.Context, builders []string, project string, limit int) ([]*builderHistory, error) {
  	// Populate the recent histories.
  	hists := make([]*builderHistory, len(builders))
  	err := parallel.WorkPool(16, func(ch chan<- func() error) {
  		for i, builder := range builders {
  			i := i
  			builder := builder
  			ch <- func() error {
  				hist, err := getHistory(c, buildsource.BuilderID(builder), project, limit)
  				if err != nil {
  					return errors.Annotate(
  						err, "error populating history for builder %s", builder).Err()
  				}
  				hists[i] = hist
  				return nil
  			}
  		}
  	})
  	if err != nil {
  		return nil, err
  	}
  
  	// for all buildbot builders, we don't have pending BuildSummary entities,
  	// so load pending counts from buildstore.
  	var buildbotBuilders []string // "<master>/<builder>" strings
  	var buildbotHists []*builderHistory
  	for _, h := range hists {
  		backend, master, builder, err := h.BuilderID.Split()
  		if backend == "buildbot" && err == nil {
  			buildbotHists = append(buildbotHists, h)
  			buildbotBuilders = append(buildbotBuilders, fmt.Sprintf("%s/%s", master, builder))
  		}
  	}
  	if len(buildbotBuilders) > 0 {
  		pendingCounts, err := buildstore.GetPendingCounts(c, buildbotBuilders)
  		if err != nil {
  			return nil, err
  		}
  		for i, count := range pendingCounts {
  			buildbotHists[i].NumPending = count
  		}
  	}
  
  	return hists, nil
  }
docs: // getBuilderHistories gets the recent histories for the builders in the given project.