Skip to content
Snippets Groups Projects
Commit eff9cf0d authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

make interarrival timer generate the right QPS with poisson load

parent e81adf3b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment