discount grpc framing bytes

pull/7333/head
David Garcia Quintas 8 years ago
parent 6eee24cfaf
commit b5c9334ae6
  1. 5
      src/core/ext/transport/chttp2/transport/writing.c
  2. 7
      test/core/end2end/tests/load_reporting_hook.c
  3. 2
      third_party/protobuf

@ -198,6 +198,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
GPR_TIMER_BEGIN("finalize_outbuf", 0); GPR_TIMER_BEGIN("finalize_outbuf", 0);
bool is_first_data_frame = true;
while ( while (
grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) { grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) {
uint32_t max_outgoing = uint32_t max_outgoing =
@ -262,6 +263,10 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
stream_writing->id, &stream_writing->flow_controlled_buffer, stream_writing->id, &stream_writing->flow_controlled_buffer,
send_bytes, is_last_frame, &stream_writing->stats, send_bytes, is_last_frame, &stream_writing->stats,
&transport_writing->outbuf); &transport_writing->outbuf);
if (is_first_data_frame) {
stream_writing->stats.data_bytes -= 5; /* discount grpc framing */
is_first_data_frame = false;
}
GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", transport_writing, GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", transport_writing,
stream_writing, outgoing_window, stream_writing, outgoing_window,
send_bytes); send_bytes);

@ -356,11 +356,8 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) {
config.tear_down_data(&f); config.tear_down_data(&f);
GPR_ASSERT(aggr_stats_server->fully_processed); GPR_ASSERT(aggr_stats_server->fully_processed);
GPR_ASSERT(aggr_stats_server->incoming_bytes == GPR_ASSERT(aggr_stats_server->incoming_bytes == strlen(request_msg));
/* 5 FIXME */ /* compression bit(1) + msg length(4) */ +strlen( GPR_ASSERT(aggr_stats_server->outgoing_bytes == strlen(response_msg));
request_msg));
GPR_ASSERT(aggr_stats_server->outgoing_bytes ==
5 /* compression bit(1) + msg length(4) */ + strlen(response_msg));
GPR_ASSERT(aggr_stats_server->call_id > 0); GPR_ASSERT(aggr_stats_server->call_id > 0);
GPR_ASSERT(aggr_stats_server->channel_id > 0); GPR_ASSERT(aggr_stats_server->channel_id > 0);

@ -1 +1 @@
Subproject commit d4d13a4349e4e59d67f311185ddcc1890d956d7a Subproject commit bdeb215cab2985195325fcd5e70c3fa751f46e0f
Loading…
Cancel
Save