aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks/fullstack_fixtures.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-04 13:23:09 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-04 13:23:09 -0700
commit1d77b44c0031bb49205d2716013439a0f925aaa2 (patch)
treeaec05813cc2741f802f1b236ce4798581e687a0c /test/cpp/microbenchmarks/fullstack_fixtures.h
parent6f9bb71c2bb3aeeee5d6dc0fee7ff1d81d2b3b41 (diff)
Add representative benchmarks of minimal stacks on chttp2
Diffstat (limited to 'test/cpp/microbenchmarks/fullstack_fixtures.h')
-rw-r--r--test/cpp/microbenchmarks/fullstack_fixtures.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h
index dc29701059..0aa3536120 100644
--- a/test/cpp/microbenchmarks/fullstack_fixtures.h
+++ b/test/cpp/microbenchmarks/fullstack_fixtures.h
@@ -61,17 +61,18 @@ extern "C" {
namespace grpc {
namespace testing {
-static void ApplyCommonServerBuilderConfig(ServerBuilder* b) {
- b->SetMaxReceiveMessageSize(INT_MAX);
- b->SetMaxSendMessageSize(INT_MAX);
-}
-
-static void ApplyCommonChannelArguments(ChannelArguments* c) {
- c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX);
- c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX);
-}
+class BaseFixture : public TrackCounters {
+ public:
+ virtual void ApplyCommonChannelArguments(ChannelArguments* c) {
+ c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX);
+ c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX);
+ }
-class BaseFixture : public TrackCounters {};
+ virtual void ApplyCommonServerBuilderConfig(ServerBuilder* b) {
+ b->SetMaxReceiveMessageSize(INT_MAX);
+ b->SetMaxSendMessageSize(INT_MAX);
+ }
+};
class FullstackFixture : public BaseFixture {
public:
@@ -238,6 +239,28 @@ class InProcessCHTTP2 : public EndpointPairFixture {
}
};
+////////////////////////////////////////////////////////////////////////////////
+// Minimal stack fixtures
+
+template <class Base>
+class MinStackize : public Base {
+ public:
+ MinStackize(Service* service) : Base(service) {}
+
+ void ApplyCommonChannelArguments(ChannelArguments* a) {
+ a->SetInt(GRPC_ARG_MINIMAL_STACK, 1);
+ }
+
+ void ApplyCommonServerBuilderConfig(ServerBuilder* b) {
+ b->AddChannelArgument(GRPC_ARG_MINIMAL_STACK, 1);
+ }
+};
+
+typedef MinStackize<TCP> MinTCP;
+typedef MinStackize<UDS> MinUDS;
+typedef MinStackize<SockPair> MinSockPair;
+typedef MinStackize<InProcessCHTTP2> MinInProcessCHTTP2;
+
} // namespace testing
} // namespace grpc