Skip to content

Commit

Permalink
Rename RpcSizeStat to RpcTransportStat
Browse files Browse the repository at this point in the history
Summary:
^ This structure is used more than just size now. And we may add more for logging.

Better rename it earlier than later.

Reviewed By: AkramaMirza

Differential Revision: D55899468

fbshipit-source-id: 4e80c73b88dc73ed188afebcf77c94f1dcfe88e2
  • Loading branch information
tlj77 authored and facebook-github-bot committed Apr 9, 2024
1 parent 3a96990 commit e65f28d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions mcrouter/lib/carbon/example/gen/HelloGoodbyeThriftTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ folly::Try<apache::thrift::RpcResponseComplete<hellogoodbye::GoodbyeReply>> send
auto reply = thriftClient->sync_complete_goodbye(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -97,7 +97,7 @@ folly::Try<apache::thrift::RpcResponseComplete<hellogoodbye::HelloReply>> sendSy
auto reply = thriftClient->sync_complete_hello(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -133,7 +133,7 @@ folly::Try<apache::thrift::RpcResponseComplete<McVersionReply>> sendSyncHelper(
auto reply = thriftClient->sync_complete_mcVersion(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -303,4 +303,4 @@ class ThriftTransport<hellogoodbye::HelloGoodbyeRouterInfo> : public ThriftTrans
};

} // namespace memcache
} // namespace facebook
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/carbon/test/gen/AThriftTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::A::TestAReply>> sen
auto reply = thriftClient->sync_complete_testA(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -94,7 +94,7 @@ folly::Try<apache::thrift::RpcResponseComplete<McVersionReply>> sendSyncHelper(
auto reply = thriftClient->sync_complete_mcVersion(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -222,4 +222,4 @@ class ThriftTransport<carbon::test::A::ARouterInfo> : public ThriftTransportMeth
};

} // namespace memcache
} // namespace facebook
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/carbon/test/gen/BThriftTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::B::TestBReply>> sen
auto reply = thriftClient->sync_complete_testB(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -94,7 +94,7 @@ folly::Try<apache::thrift::RpcResponseComplete<McVersionReply>> sendSyncHelper(
auto reply = thriftClient->sync_complete_mcVersion(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -222,4 +222,4 @@ class ThriftTransport<carbon::test::B::BRouterInfo> : public ThriftTransportMeth
};

} // namespace memcache
} // namespace facebook
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/lib/carbon/test/gen/CarbonTestThriftTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::TestReply>> sendSyn
auto reply = thriftClient->sync_complete_test(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -94,7 +94,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::TestReplyStringKey>
auto reply = thriftClient->sync_complete_testStringKey(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -130,7 +130,7 @@ folly::Try<apache::thrift::RpcResponseComplete<McVersionReply>> sendSyncHelper(
auto reply = thriftClient->sync_complete_mcVersion(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -277,4 +277,4 @@ class ThriftTransport<carbon::test::CarbonTestRouterInfo> : public ThriftTranspo
};

} // namespace memcache
} // namespace facebook
} // namespace facebook
10 changes: 5 additions & 5 deletions mcrouter/lib/carbon/test/gen/CarbonThriftTestThriftTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::CustomReply>> sendS
auto reply = thriftClient->sync_complete_customRequest(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -94,7 +94,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::DummyThriftReply>>
auto reply = thriftClient->sync_complete_thrift_test(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -130,7 +130,7 @@ folly::Try<apache::thrift::RpcResponseComplete<carbon::test::ThriftTestReply>> s
auto reply = thriftClient->sync_complete_test(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -166,7 +166,7 @@ folly::Try<apache::thrift::RpcResponseComplete<McVersionReply>> sendSyncHelper(
auto reply = thriftClient->sync_complete_mcVersion(
std::move(rpcOptions), request);
if (rpcStatsContext && reply.hasValue()) {
auto& stats = reply->responseContext.rpcSizeStats;
auto& stats = reply->responseContext.rpcTransportStats;
rpcStatsContext->requestBodySize = stats.requestSerializedSizeBytes;
rpcStatsContext->replySizeBeforeCompression = stats.responseSerializedSizeBytes;
rpcStatsContext->replySizeAfterCompression = stats.responseWireSizeBytes;
Expand Down Expand Up @@ -332,4 +332,4 @@ class ThriftTransport<carbon::test::CarbonThriftTestRouterInfo> : public ThriftT
};

} // namespace memcache
} // namespace facebook
} // namespace facebook
Loading

0 comments on commit e65f28d

Please sign in to comment.