Skip to content

Commit a76d3bf

Browse files
Adding cool down period for specific executors (#504)
* Adding Cool down period for virtual client component * Adding Cool down period * Adding Cool down period * Updating version --------- Co-authored-by: Deepanshu Vaid <devaid@microsoft.com>
1 parent abe6a1a commit a76d3bf

4 files changed

Lines changed: 45 additions & 2 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.12
1+
2.0.13

src/VirtualClient/VirtualClient.Actions/FIO/FioExecutor.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,18 @@ public string CommandLine
7676
this.Parameters[nameof(DiskWorkloadExecutor.CommandLine)] = value;
7777
}
7878
}
79-
79+
80+
/// <summary>
81+
/// The Cool down period for Virtual Client Component.
82+
/// </summary>
83+
public TimeSpan CoolDownPeriod
84+
{
85+
get
86+
{
87+
return this.Parameters.GetTimeSpanValue(nameof(this.CoolDownPeriod), TimeSpan.FromSeconds(0));
88+
}
89+
}
90+
8091
/// <summary>
8192
/// Defines the job files specified in the profile.
8293
/// </summary>
@@ -377,6 +388,9 @@ await this.DeleteTestFilesAsync(workload.TestFiles)
377388
.ConfigureAwait(false);
378389
}
379390
}
391+
392+
// TO DO: Remove once we have Loop Executor.
393+
await this.WaitAsync(this.CoolDownPeriod, cancellationToken);
380394
}
381395

382396
if (!string.IsNullOrEmpty(this.JobFiles))

src/VirtualClient/VirtualClient.Actions/Network/NetworkingWorkload/NetworkingWorkloadExecutor.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,17 @@ public int? ConnectionsPerThread
338338
}
339339
}
340340

341+
/// <summary>
342+
/// The Cool down period for Virtual Client Component.
343+
/// </summary>
344+
public TimeSpan CoolDownPeriod
345+
{
346+
get
347+
{
348+
return this.Parameters.GetTimeSpanValue(nameof(this.CoolDownPeriod), TimeSpan.FromSeconds(0));
349+
}
350+
}
351+
341352
/// <summary>
342353
/// Parameter defines the differentiator for which to convey the number of interrupts in the workload toolset tests.
343354
/// </summary>
@@ -619,6 +630,10 @@ await this.ExecuteServerAsync(telemetryContext, cancellationToken)
619630
{
620631
throw new NotSupportedException($"The role: {this.Role} is not supported.");
621632
}
633+
634+
// TO DO: Remove once we have Loop Executor.
635+
await this.WaitAsync(this.CoolDownPeriod, cancellationToken);
636+
622637
}
623638

624639
/// <summary>

src/VirtualClient/VirtualClient.Actions/StressNg/StressNgExecutor.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ public StressNgExecutor(IServiceCollection dependencies, IDictionary<string, ICo
5050
this.fileSystem = this.systemManagement.FileSystem;
5151
}
5252

53+
/// <summary>
54+
/// The Cool down period for Virtual Client Component.
55+
/// </summary>
56+
public TimeSpan CoolDownPeriod
57+
{
58+
get
59+
{
60+
return this.Parameters.GetTimeSpanValue(nameof(this.CoolDownPeriod), TimeSpan.FromSeconds(0));
61+
}
62+
}
63+
5364
/// <summary>
5465
/// The command line argument defined in the profile.
5566
/// </summary>
@@ -84,6 +95,9 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
8495
}
8596
}
8697
}
98+
99+
// TO DO: Remove once we have Loop Executor.
100+
await this.WaitAsync(this.CoolDownPeriod, cancellationToken);
87101
}
88102

89103
/// <summary>

0 commit comments

Comments
 (0)