func (l *Load) sendMulti(client *gen.HFileServiceClient, diff *gen.HFileServiceClient) {
	var wg sync.WaitGroup
	keys := l.randomKeys()
	r := &gen.SingleHFileKeyRequest{HfileName: &l.collection, SortedKeys: keys}
	var diffResp *gen.MultiHFileKeyResponse
	var diffErr error
	if diff != nil {
		wg.Add(1)
		go func() {
			defer wg.Done()
			beforeDiff := time.Now()
			diffResp, diffErr = diff.GetValuesMulti(r)
			if diffErr != nil {
				log.Println("[GetValuesMulti] Error fetching diff value:", renderErr(diffErr), util.PrettyKeys(keys))
			}
			report.TimeSince(l.diffRtt+".overall", beforeDiff)
			report.TimeSince(l.diffRtt+".getValuesMulti", beforeDiff)
		}()
	}
	before := time.Now()
	resp, err := client.GetValuesMulti(r)
	if err != nil {
		log.Println("[GetValuesMulti] Error fetching value:", renderErr(err), util.PrettyKeys(keys))
	}
	report.TimeSince(l.rtt+".overall", before)
	report.TimeSince(l.rtt+".getValuesMulti", before)
	if diff != nil {
		wg.Wait()
		if err == nil && diffErr == nil && !reflect.DeepEqual(resp, diffResp) {
			report.Inc("diffs")
			report.Inc("diffs.getValuesMulti")
			log.Printf("[DIFF-getValuesMulti] req: %v\n \torig: %v\n\n\tdiff: %v\n", r, resp, diffResp)
		}
	}
}
Generate and send a random GetValuesSingle request.
package main
import (
	"encoding/hex"
	"log"
	"math/rand"
	"reflect"
	"sort"
	"sync"
	"time"
	"github.com/foursquare/fsgo/report"
	"github.com/foursquare/quiver/gen"
	"github.com/foursquare/quiver/util"
)
func renderErr(raw error) string {
	msg := raw.Error()
	switch e := raw.(type) {
	case *gen.HFileServiceException:
		msg = e.GetMessage()
	default:
	}
	return msg
}
func (l *Load) startWorkers(count int, maxQps bool) {
	for i := 0; i < count; i++ {
		go func() {
			client := GetQuiverClient(l.server)
			var diff *gen.HFileServiceClient
			if l.diffing {
				diff = GetQuiverClient(l.diff)
			}
			for {
				if !maxQps {
					<-l.work
				}
				l.sendOne(client, diff)
			}
		}()
	}
}
func (l *Load) sendOne(client *gen.HFileServiceClient, diff *gen.HFileServiceClient) {
	i := rand.Int31n(100)
	switch {
	case i < l.mixPrefix:
		l.sendPrefixes(client, diff)
	case i < l.mixIterator:
		l.sendGetIterator(client, diff)
	case i < l.mixMulti:
		l.sendMulti(client, diff)
	default:
		l.sendSingle(client, diff)
	}
}
func (l *Load) sendSingle(client *gen.HFileServiceClient, diff *gen.HFileServiceClient) {
	var wg sync.WaitGroup
	keys := l.randomKeys()
	r := &gen.SingleHFileKeyRequest{HfileName: &l.collection, SortedKeys: keys}
	var diffResp *gen.SingleHFileKeyResponse
	var diffErr error
	if diff != nil {
		wg.Add(1)
		go func() {
			defer wg.Done()
			beforeDiff := time.Now()
			diffResp, diffErr = diff.GetValuesSingle(r)
			if diffErr != nil {
				log.Println("[GetValuesSingle] Error fetching diff value:", renderErr(diffErr), util.PrettyKeys(keys))
			}
			report.TimeSince(l.diffRtt+".overall", beforeDiff)
			report.TimeSince(l.diffRtt+".getValuesSingle", beforeDiff)
		}()
	}
	before := time.Now()
	resp, err := client.GetValuesSingle(r)
	if err != nil {
		log.Println("[GetValuesSingle] Error fetching value:", renderErr(err), util.PrettyKeys(keys))
	}
	report.TimeSince(l.rtt+".overall", before)
	report.TimeSince(l.rtt+".getValuesSingle", before)
	if diff != nil {
		wg.Wait()
		if err == nil && diffErr == nil && !reflect.DeepEqual(resp, diffResp) {
			report.Inc("diffs")
			report.Inc("diffs.getValuesSingle")
			log.Printf("[DIFF-getValuesSingle] req: %v\n%s\torig (%d): %v\n\tdiff (%d): %v\n", r, util.PrettyKeys(keys), resp.GetKeyCount(), resp, diffResp.GetKeyCount(), diffResp)
		}
	}
}