Ejemplo n.º 1
0
func printMeta(client crowdsound.CrowdSoundClient) {
	resp, err := client.GetSessionData(context.Background(), &crowdsound.GetSessionDataRequest{})
	if err != nil {
		log.Fatalf("Error calling GetSessionData(): %v", err)
	}

	log.Println("Session Data:", resp)
}
Ejemplo n.º 2
0
func RunGetSessionDataBench(c crowdsound.CrowdSoundClient, amount int) (metrics.Histogram, error) {
	h := metrics.NewHistogram(metrics.NewUniformSample(amount))
	for i := 0; i < amount; i++ {
		start := time.Now()
		if _, err := c.GetSessionData(context.Background(), &crowdsound.GetSessionDataRequest{}); err != nil {
			return h, err
		}

		h.Update(time.Since(start).Nanoseconds())
	}

	return h, nil
}