diff options
author | vjpai <vpai@google.com> | 2016-03-30 12:07:19 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2016-03-30 12:07:19 -0700 |
commit | 5286eee5a9b08da78ba5bb54e5d2e1473e8bb4ae (patch) | |
tree | 3ddc2387fdb58f98484342997bc30d4a7e043d1c /src/ruby | |
parent | ad1c1cc6cf4495b2af05058335869eafedd3e9fb (diff) |
Add streaming client
Diffstat (limited to 'src/ruby')
-rw-r--r-- | src/ruby/qps/client.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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( |