Skip to content

Commit

Permalink
InstanceNumberDistributionExample
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Apr 10, 2024
1 parent 30cf8c0 commit 051cc5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Demo.Features.DynamicWorkload;

public class ThreadIdDistributionExample
public class InstanceNumberDistributionExample
{
public void Run()
{
var scenario = Scenario.Create("home_page", async context =>
{
if (context.ScenarioInfo.ThreadNumber % 9 < 3)
if (context.ScenarioInfo.InstanceNumber % 9 < 3)
{
// 0-2 range, run step 1
await Step.Run("step_1", context, async () =>
Expand All @@ -17,7 +17,7 @@ await Step.Run("step_1", context, async () =>
return Response.Ok();
});
}
else if (context.ScenarioInfo.ThreadNumber % 9 < 6)
else if (context.ScenarioInfo.InstanceNumber % 9 < 6)
{
// 3-5 range, run step 2
await Step.Run("step_2", context, async () =>
Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
// new HttpWithTimeoutExample().Run();

// ---- Dynamic Workloads ----
// new ThreadIdDistributionExample().Run();
// new InstanceNumberDistributionExample().Run();
// new UniformDistributionExample().Run();
// new ZipfianDistributionExample().Run();
// new MultinomialDistributionExample().Run();
Expand Down

0 comments on commit 051cc5b

Please sign in to comment.