From 5286eee5a9b08da78ba5bb54e5d2e1473e8bb4ae Mon Sep 17 00:00:00 2001 From: vjpai Date: Wed, 30 Mar 2016 12:07:19 -0700 Subject: Add streaming client --- src/ruby/qps/client.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ruby') diff --git a/src/ruby/qps/client.rb b/src/ruby/qps/client.rb index aa57b06c97..30d096831b 100644 --- a/src/ruby/qps/client.rb +++ b/src/ruby/qps/client.rb @@ -115,6 +115,21 @@ class BenchmarkClient end end def streaming_ping_ponger(req, stub, config, waiter) + q = EnumeratorQueue.new(self) + resp = stub.streaming_call(q.each_item) + start = Time.now + q.push(req) + resp.each do |r| + @histogram.add((Time.now-start)*1e9) + if !@done + wait_to_issue(waiter) + start = Time.now + q.push(req) + else + q.push(self) + break + end + end end def mark(reset) lat = Grpc::Testing::HistogramData.new( -- cgit v1.2.3