Skip to content

Commit

Permalink
chore: put capacity for benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
guitarrapc committed Nov 5, 2024
1 parent 3ab545b commit a8d8fca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ public void Ready()
hardwarePerformanceReporter.Start();
}

public void Complete()
{
isRunning = false;
stopwatch.Stop();
hardwarePerformanceReporter.Stop();
}

public void Increment()
{
if (isRunning)
Expand Down Expand Up @@ -62,13 +69,6 @@ public void Error()
Interlocked.Increment(ref errorsPerConnection);
}

public void Complete()
{
isRunning = false;
stopwatch.Stop();
hardwarePerformanceReporter.Stop();
}

public PerformanceResult GetResult()
{
var latency = MeasureLatency(latencyPerConnection);
Expand Down
5 changes: 2 additions & 3 deletions perf/BenchmarkApp/PerformanceTest.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async Task Main(
{
if (!resultsByScenario.TryGetValue(scenario2, out var results))
{
results = new List<PerformanceResult>();
results = new List<PerformanceResult>(10000);
resultsByScenario[scenario2] = results;
}
var result = await RunScenarioAsync(scenario2, config, config.ChannelList, controlServiceClient);
Expand All @@ -103,7 +103,6 @@ async Task Main(
}
WriteLog($"All scenario complete");


WriteLog($"Saving metrics...");
foreach (var (s, results) in resultsByScenario)
{
Expand Down Expand Up @@ -314,7 +313,7 @@ IEnumerable<ScenarioType> GetRunScenarios(ScenarioType scenario)
return scenario switch
{
ScenarioType.All => Enum.GetValues<ScenarioType>().Where(x => x != ScenarioType.All && x != ScenarioType.CI),
//ScenarioType.CI => Enum.GetValues<ScenarioType>().Where(x => x == ScenarioType.Unary || x == ScenarioType.StreamingHub || x == ScenarioType.ServerStreaming),
// Do not include ServerStreaming to CI. ServerStreaming consume a lot of resource and will impact later scenarios.
ScenarioType.CI => Enum.GetValues<ScenarioType>().Where(x => x == ScenarioType.Unary || x == ScenarioType.StreamingHub),
_ => [scenario],
};
Expand Down

0 comments on commit a8d8fca

Please sign in to comment.