|
|
@ -143,8 +143,8 @@ extern const char *kCFStreamVarName; |
|
|
|
messageCallback:^(id message) { |
|
|
|
messageCallback:^(id message) { |
|
|
|
int indexCopy; |
|
|
|
int indexCopy; |
|
|
|
@synchronized(self) { |
|
|
|
@synchronized(self) { |
|
|
|
index += 1; |
|
|
|
|
|
|
|
indexCopy = index; |
|
|
|
indexCopy = index; |
|
|
|
|
|
|
|
index += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
if (indexCopy < numMessages) { |
|
|
|
if (indexCopy < numMessages) { |
|
|
|
[call writeMessage:request]; |
|
|
|
[call writeMessage:request]; |
|
|
@ -181,7 +181,7 @@ extern const char *kCFStreamVarName; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
|
|
|
|
|
|
|
|
[self measureBlock:^{ |
|
|
|
[self measureBlock:^{ |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:10000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -198,7 +198,7 @@ extern const char *kCFStreamVarName; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
|
|
|
|
|
|
|
|
[self measureBlock:^{ |
|
|
|
[self measureBlock:^{ |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:10000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -215,7 +215,7 @@ extern const char *kCFStreamVarName; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
|
|
|
|
|
|
|
|
[self measureBlock:^{ |
|
|
|
[self measureBlock:^{ |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:10000 options:options]; |
|
|
|
[self pingPongV2APIWithRequest:request numMessages:1000 options:options]; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -254,7 +254,7 @@ extern const char *kCFStreamVarName; |
|
|
|
id request = [RMTStreamingOutputCallRequest messageWithPayloadSize:@1 requestedResponseSize:@1]; |
|
|
|
id request = [RMTStreamingOutputCallRequest messageWithPayloadSize:@1 requestedResponseSize:@1]; |
|
|
|
[self pingPongV1APIWithRequest:request numMessages:1000]; |
|
|
|
[self pingPongV1APIWithRequest:request numMessages:1000]; |
|
|
|
[self measureBlock:^{ |
|
|
|
[self measureBlock:^{ |
|
|
|
[self pingPongV1APIWithRequest:request numMessages:10000]; |
|
|
|
[self pingPongV1APIWithRequest:request numMessages:1000]; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -298,7 +298,7 @@ extern const char *kCFStreamVarName; |
|
|
|
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; |
|
|
|
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)testUnaryRPC { |
|
|
|
- (void)test1MBUnaryRPC { |
|
|
|
// Workaround Apple CFStream bug |
|
|
|
// Workaround Apple CFStream bug |
|
|
|
if ([self isUsingCFStream]) { |
|
|
|
if ([self isUsingCFStream]) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -329,6 +329,32 @@ extern const char *kCFStreamVarName; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)test1KBUnaryRPC { |
|
|
|
|
|
|
|
RMTSimpleRequest *request = [RMTSimpleRequest message]; |
|
|
|
|
|
|
|
request.responseSize = 1024; |
|
|
|
|
|
|
|
request.payload.body = [NSMutableData dataWithLength:1024]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init]; |
|
|
|
|
|
|
|
options.transport = [[self class] transport]; |
|
|
|
|
|
|
|
options.PEMRootCertificates = [[self class] PEMRootCertificates]; |
|
|
|
|
|
|
|
options.hostNameOverride = [[self class] hostNameOverride]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// warm up |
|
|
|
|
|
|
|
[self unaryRPCsWithServices:@[ self->_service ] |
|
|
|
|
|
|
|
request:request |
|
|
|
|
|
|
|
callsPerService:1000 |
|
|
|
|
|
|
|
maxOutstandingCalls:100 |
|
|
|
|
|
|
|
callOptions:options]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self measureBlock:^{ |
|
|
|
|
|
|
|
[self unaryRPCsWithServices:@[ self->_service ] |
|
|
|
|
|
|
|
request:request |
|
|
|
|
|
|
|
callsPerService:1000 |
|
|
|
|
|
|
|
maxOutstandingCalls:100 |
|
|
|
|
|
|
|
callOptions:options]; |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)testMultipleChannels { |
|
|
|
- (void)testMultipleChannels { |
|
|
|
NSString *port = [[[self class] host] componentsSeparatedByString:@":"][1]; |
|
|
|
NSString *port = [[[self class] host] componentsSeparatedByString:@":"][1]; |
|
|
|
int kNumAddrs = 10; |
|
|
|
int kNumAddrs = 10; |
|
|
|