blob: 03bd219551498d666ca8d15e0b292a3a62e9b0fe [file] [log] [blame]
// a simple command-line tool to run the benchmark client.
package main
import (
"flag"
"os"
"veyron.io/veyron/veyron/runtimes/google/ipc/benchmarks"
"veyron.io/veyron/veyron2/rt"
)
var (
server = flag.String("server", "", "object name of the server to connect to")
count = flag.Int("count", 1, "number of RPCs to send")
chunkCount = flag.Int("chunk_count", 0, "number of stream chunks to send")
payloadSize = flag.Int("payload_size", 32, "the size of the payload")
)
func main() {
runtime, err := rt.New()
if err != nil {
panic(err)
}
defer runtime.Cleanup()
ctx := runtime.NewContext()
if *chunkCount == 0 {
benchmarks.CallEcho(ctx, *server, *count, *payloadSize, os.Stdout)
} else {
benchmarks.CallEchoStream(runtime, *server, *count, *chunkCount, *payloadSize, os.Stdout)
}
}