aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-05 10:37:35 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-05 11:58:31 -0700
commiteff9cf0d6794203b17d17d129a311ccf9fb9c33f (patch)
tree98a64e37a793ec93d420abd25149bab65e1b58d6 /src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs
parente81adf3b7b61ff3b0f8918c085fcd7004b2ed53d (diff)
make interarrival timer generate the right QPS with poisson load
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs b/src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs
index e8d7cbe8bb..6492d34890 100644
--- a/src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs
+++ b/src/csharp/Grpc.IntegrationTesting/InterarrivalTimers.cs
@@ -78,8 +78,6 @@ namespace Grpc.IntegrationTesting
/// </summary>
public class PoissonInterarrivalTimer : IInterarrivalTimer
{
- const double NanosToSeconds = 1e-9;
-
readonly ExponentialDistribution exponentialDistribution;
DateTime? lastEventTime;
@@ -119,7 +117,7 @@ namespace Grpc.IntegrationTesting
}
var origLastEventTime = this.lastEventTime.Value;
- this.lastEventTime = origLastEventTime + TimeSpan.FromSeconds(exponentialDistribution.Next() * NanosToSeconds);
+ this.lastEventTime = origLastEventTime + TimeSpan.FromSeconds(exponentialDistribution.Next());
return this.lastEventTime.Value - origLastEventTime;
}