diff --git a/src/VirtualClient/VirtualClient.Actions/Prime95/Prime95Executor.cs b/src/VirtualClient/VirtualClient.Actions/Prime95/Prime95Executor.cs index 36ccb0048a..f0be3be713 100644 --- a/src/VirtualClient/VirtualClient.Actions/Prime95/Prime95Executor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Prime95/Prime95Executor.cs @@ -8,10 +8,8 @@ namespace VirtualClient.Actions using System.IO; using System.IO.Abstractions; using System.Linq; - using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using VirtualClient.Common; using VirtualClient.Common.Extensions; @@ -27,6 +25,7 @@ public class Prime95Executor : VirtualClientComponent { private IFileSystem fileSystem; private IPackageManager packageManager; + private ProcessManager processManager; private ISystemManagement systemManagement; private List successExitCodes; @@ -41,6 +40,7 @@ public Prime95Executor(IServiceCollection dependencies, IDictionary(); this.packageManager = this.systemManagement.PackageManager; this.fileSystem = this.systemManagement.FileSystem; + this.processManager = this.systemManagement.ProcessManager; // The exit code on SafeKill is -1 which is not a part of the default success codes. this.successExitCodes = new List(ProcessProxy.DefaultSuccessCodes) { -1 }; @@ -279,7 +279,7 @@ private async Task ExecuteWorkloadAsync(EventContext telemetryContext, Cancellat await this.Logger.LogMessageAsync($"{this.TypeName}.ExecuteWorkload", telemetryContext, async () => { - using (IProcessProxy process = this.systemManagement.ProcessManager.CreateProcess(this.ExecutablePath, commandArguments, this.Prime95Package.Path)) + using (IProcessProxy process = this.processManager.CreateProcess(this.ExecutablePath, commandArguments, this.Prime95Package.Path)) { this.CleanupTasks.Add(() => process.SafeKill()); @@ -290,7 +290,7 @@ await this.Logger.LogMessageAsync($"{this.TypeName}.ExecuteWorkload", telemetryC if (process.Start()) { await this.WaitAsync(explicitTimeout, cancellationToken); - process.SafeKill(); + this.processManager.Kill(new List { process.Name }); if (!cancellationToken.IsCancellationRequested) { @@ -302,7 +302,7 @@ await this.Logger.LogMessageAsync($"{this.TypeName}.ExecuteWorkload", telemetryC { results = await this.fileSystem.File.ReadAllTextAsync(this.ResultsFilePath); } - + if (string.IsNullOrWhiteSpace(results)) { throw new WorkloadResultsException( @@ -310,7 +310,6 @@ await this.Logger.LogMessageAsync($"{this.TypeName}.ExecuteWorkload", telemetryC ErrorReason.WorkloadResultsNotFound); } - // The exit code on SafeKill is -1 which is not a part of the default success codes. process.ThrowIfWorkloadFailed(this.successExitCodes); this.CaptureMetrics(process, results, telemetryContext, cancellationToken); } diff --git a/website/docs/workloads/prime95/prime95.md b/website/docs/workloads/prime95/prime95.md index afe5e371b8..b26d381f36 100644 --- a/website/docs/workloads/prime95/prime95.md +++ b/website/docs/workloads/prime95/prime95.md @@ -41,7 +41,6 @@ The following list describes the measurements captured by the workload running a * Number of Tests passed. * Number of Tests failed. -* Time-to-Compute the Tests (in seconds). ## Workload Metrics The following metrics are examples of those captured by the Virtual Client when running the Prime95 workload. @@ -54,5 +53,4 @@ for which the system was stressed with torture test. A higher the test time with | Metric Name | Example Value (min) | Example Value (max) | Example Value (avg) | Unit | |--------------|---------------------|---------------------|---------------------|------| | failTestCount | 0.0 | 0.0 | 0.0 | | -| passTestCount | 32.0 | 192.0 | 115.45833333333333 | | -| testTime | 3600.0031989 | 3601.679443 | 3600.23347608125 | seconds | \ No newline at end of file +| passTestCount | 32.0 | 192.0 | 115.45833333333333 | | \ No newline at end of file