コード例 #1
0
ファイル: main.go プロジェクト: CrowdSoundSystem/go-client
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)
}
コード例 #2
0
ファイル: posters.go プロジェクト: CrowdSoundSystem/go-client
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
}