aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-07-13 19:45:51 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-07-18 17:06:58 -0700
commit3c909d55fd56a8fd3d4b25d88722ded67dae3c51 (patch)
treec1aae416843bbd2c421da8c740be5048a1620696 /test/cpp/microbenchmarks
parent2d1c61699ecb10bca0fc735f38766ba370bf6ea0 (diff)
Pull out flow control objects
Diffstat (limited to 'test/cpp/microbenchmarks')
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_transport.cc37
-rw-r--r--test/cpp/microbenchmarks/bm_fullstack_trickle.cc17
2 files changed, 28 insertions, 26 deletions
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index 9193330f78..cb113c5254 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -391,8 +391,9 @@ static void BM_TransportStreamSend(benchmark::State &state) {
MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
if (!state.KeepRunning()) return;
// force outgoing window to be yuge
- s.chttp2_stream()->remote_window_delta = 1024 * 1024 * 1024;
- f.chttp2_transport()->remote_window = 1024 * 1024 * 1024;
+ s.chttp2_stream()->flow_control.remote_window_delta =
+ 1024 * 1024 * 1024;
+ f.chttp2_transport()->flow_control.remote_window = 1024 * 1024 * 1024;
grpc_slice_buffer_stream_init(&send_stream, &send_buffer, 0);
reset_op();
op.on_complete = c.get();
@@ -517,22 +518,22 @@ static void BM_TransportStreamRecv(benchmark::State &state) {
std::unique_ptr<Closure> drain_continue;
grpc_slice recv_slice;
- std::unique_ptr<Closure> c =
- MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
- if (!state.KeepRunning()) return;
- // force outgoing window to be yuge
- s.chttp2_stream()->local_window_delta = 1024 * 1024 * 1024;
- s.chttp2_stream()->announced_window_delta = 1024 * 1024 * 1024;
- f.chttp2_transport()->announced_window = 1024 * 1024 * 1024;
- received = 0;
- reset_op();
- op.on_complete = do_nothing.get();
- op.recv_message = true;
- op.payload->recv_message.recv_message = &recv_stream;
- op.payload->recv_message.recv_message_ready = drain_start.get();
- s.Op(&op);
- f.PushInput(grpc_slice_ref(incoming_data));
- });
+ std::unique_ptr<Closure> c = MakeClosure([&](grpc_exec_ctx *exec_ctx,
+ grpc_error *error) {
+ if (!state.KeepRunning()) return;
+ // force outgoing window to be yuge
+ s.chttp2_stream()->flow_control.local_window_delta = 1024 * 1024 * 1024;
+ s.chttp2_stream()->flow_control.announced_window_delta = 1024 * 1024 * 1024;
+ f.chttp2_transport()->flow_control.announced_window = 1024 * 1024 * 1024;
+ received = 0;
+ reset_op();
+ op.on_complete = do_nothing.get();
+ op.recv_message = true;
+ op.payload->recv_message.recv_message = &recv_stream;
+ op.payload->recv_message.recv_message_ready = drain_start.get();
+ s.Op(&op);
+ f.PushInput(grpc_slice_ref(incoming_data));
+ });
drain_start = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
if (recv_stream == NULL) {
diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
index 13c96ef3e1..5c44b9751f 100644
--- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
@@ -127,14 +127,15 @@ class TrickledCHTTP2 : public EndpointPairFixture {
client->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
server->lists[GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT].head != nullptr,
server->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
- client->remote_window, server->remote_window, client->announced_window,
- server->announced_window,
- client_stream ? client_stream->remote_window_delta : -1,
- server_stream ? server_stream->remote_window_delta : -1,
- client_stream ? client_stream->local_window_delta : -1,
- server_stream ? server_stream->local_window_delta : -1,
- client_stream ? client_stream->announced_window_delta : -1,
- server_stream ? server_stream->announced_window_delta : -1,
+ client->flow_control.remote_window, server->flow_control.remote_window,
+ client->flow_control.announced_window,
+ server->flow_control.announced_window,
+ client_stream ? client_stream->flow_control.remote_window_delta : -1,
+ server_stream ? server_stream->flow_control.remote_window_delta : -1,
+ client_stream ? client_stream->flow_control.local_window_delta : -1,
+ server_stream ? server_stream->flow_control.local_window_delta : -1,
+ client_stream ? client_stream->flow_control.announced_window_delta : -1,
+ server_stream ? server_stream->flow_control.announced_window_delta : -1,
client->settings[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
client->settings[GRPC_LOCAL_SETTINGS]