aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-03-21 09:46:15 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-03-25 16:28:16 -0700
commit3d6644aefd73f5030ad46154917c4a2732544e82 (patch)
treeb0daf033f4d22a7aab272430700134813e72bf7e /src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
parentf3d76384351039266e250aacf97c90d5b0c07dca (diff)
improve C# qps worker
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/ClientRunners.cs')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/ClientRunners.cs37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
index c4016012cb..3223d0d080 100644
--- a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
+++ b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
@@ -41,6 +41,7 @@ using System.Threading;
using System.Threading.Tasks;
using Google.Protobuf;
using Grpc.Core;
+using Grpc.Core.Logging;
using Grpc.Core.Utils;
using NUnit.Framework;
using Grpc.Testing;
@@ -50,18 +51,48 @@ namespace Grpc.IntegrationTesting
/// <summary>
/// Helper methods to start client runners for performance testing.
/// </summary>
- public static class ClientRunners
+ public class ClientRunners
{
+ static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<ClientRunners>();
+
/// <summary>
/// Creates a started client runner.
/// </summary>
public static IClientRunner CreateStarted(ClientConfig config)
{
+ Logger.Debug("ClientConfig: {0}", config);
string target = config.ServerTargets.Single();
- GrpcPreconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop);
+ GrpcPreconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop,
+ "Only closed loop scenario supported for C#");
+ GrpcPreconditions.CheckArgument(config.ClientChannels == 1, "ClientConfig.ClientChannels needs to be 1");
+
+ if (config.OutstandingRpcsPerChannel != 0)
+ {
+ Logger.Warning("ClientConfig.OutstandingRpcsPerChannel is not supported for C#. Ignoring the value");
+ }
+ if (config.AsyncClientThreads != 0)
+ {
+ Logger.Warning("ClientConfig.AsyncClientThreads is not supported for C#. Ignoring the value");
+ }
+ if (config.CoreLimit != 0)
+ {
+ Logger.Warning("ClientConfig.CoreLimit is not supported for C#. Ignoring the value");
+ }
+ if (config.CoreList.Count > 0)
+ {
+ Logger.Warning("ClientConfig.CoreList is not supported for C#. Ignoring the value");
+ }
var credentials = config.SecurityParams != null ? TestCredentials.CreateSslCredentials() : ChannelCredentials.Insecure;
- var channel = new Channel(target, credentials);
+ List<ChannelOption> channelOptions = null;
+ if (config.SecurityParams != null && config.SecurityParams.ServerHostOverride != "")
+ {
+ channelOptions = new List<ChannelOption>
+ {
+ new ChannelOption(ChannelOptions.SslTargetNameOverride, config.SecurityParams.ServerHostOverride)
+ };
+ }
+ var channel = new Channel(target, credentials, channelOptions);
switch (config.RpcType)
{