Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --password [A-Za-z0-9+/=]+",
$"python3 {this.mySQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\"",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 0 --password [A-Za-z0-9+/=]+",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
};
}
}
Expand Down Expand Up @@ -545,7 +545,7 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
{
"apt install python3 --yes --quiet",
$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath {this.sysbenchPackagePath}",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
};
}
}
Expand Down Expand Up @@ -596,9 +596,9 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --password [A-Za-z0-9+/=]+",
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\" --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 0 --password [A-Za-z0-9+/=]+",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
};
}
}
Expand Down Expand Up @@ -628,7 +628,7 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
{
"apt install python3 --yes --quiet",
$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem PostgreSQL --packagePath {this.sysbenchPackagePath}",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedTPCCWorkloadCommand()
this.fixture.Parameters[nameof(SysbenchClientExecutor.Benchmark)] = "TPCC";
this.fixture.Parameters[nameof(SysbenchClientExecutor.Workload)] = "tpcc";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 10 --password [A-Za-z0-9+/=]+";
string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 10 --password [A-Za-z0-9+/=]+";
bool commandExecuted = false;

this.fixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) =>
Expand Down Expand Up @@ -354,7 +354,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedPostgreSQLTPCCWorkloadCom
this.fixture.Parameters[nameof(SysbenchClientExecutor.Benchmark)] = "TPCC";
this.fixture.Parameters[nameof(SysbenchClientExecutor.Workload)] = "tpcc";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 10 --password [A-Za-z0-9+/=]+";
string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 1 --workload tpcc --hostIpAddress 1.2.3.5 --durationSecs 10 --password [A-Za-z0-9+/=]+";
bool commandExecuted = false;

this.fixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public async Task SysbenchConfigurationProperlyExecutesTPCCPreparation()

string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 100 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 --tableCount 10 --warehouses 0 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
};

int commandNumber = 0;
Expand Down Expand Up @@ -332,7 +332,7 @@ public async Task SysbenchConfigurationProperlyExecutesTPCCConfigurablePreparati

string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 16 --tableCount 40 --warehouses 1000 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 16 --tableCount 40 --warehouses 999 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
};

int commandNumber = 0;
Expand Down Expand Up @@ -446,7 +446,7 @@ public async Task SysbenchConfigurationProperlyExecutesPostgreSQLTPCCConfigurabl

string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 16 --tableCount 40 --warehouses 1000 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 16 --tableCount 40 --warehouses 999 --password [A-Za-z0-9+/=]+ --host \"1.2.3.5\""
};

int commandNumber = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,69 +179,28 @@ private Task ExecuteWorkloadAsync(EventContext telemetryContext, CancellationTok
{
using (BackgroundOperations profiling = BackgroundOperations.BeginProfiling(this, cancellationToken))
{
switch (this.Benchmark)
{
case BenchmarkName.OLTP:
await this.RunOLTPWorkloadAsync(telemetryContext, cancellationToken);
break;
case BenchmarkName.TPCC:
await this.RunTPCCWorkloadAsync(telemetryContext, cancellationToken);
break;
default:
throw new DependencyException(
$"The '{this.Benchmark}' benchmark is not supported with the Sysbench workload. Supported options include: \"OLTP, TPCC\".",
ErrorReason.NotSupported);
}
}
});
}

private async Task RunOLTPWorkloadAsync(EventContext telemetryContext, CancellationToken cancellationToken)
{
this.sysbenchLoggingArguments = this.BuildSysbenchLoggingArguments(prepare: false);
this.sysbenchExecutionArguments = $"{this.sysbenchLoggingArguments} --workload {this.Workload} --hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}";

string script = $"{this.SysbenchPackagePath}/run-workload.py ";

using (IProcessProxy process = await this.ExecuteCommandAsync(
SysbenchExecutor.PythonCommand,
script + this.sysbenchExecutionArguments,
this.SysbenchPackagePath,
telemetryContext,
cancellationToken))
{
if (!cancellationToken.IsCancellationRequested)
{
await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true);
process.ThrowIfErrored<WorkloadException>(process.StandardError.ToString(), ErrorReason.WorkloadFailed);

this.CaptureMetrics(process, telemetryContext, cancellationToken);
}
}
}

private async Task RunTPCCWorkloadAsync(EventContext telemetryContext, CancellationToken cancellationToken)
{
this.sysbenchLoggingArguments = this.BuildSysbenchLoggingArguments(prepare: false);
this.sysbenchExecutionArguments = $"{this.sysbenchLoggingArguments} --workload {this.Workload} --hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}";
this.sysbenchLoggingArguments = this.BuildSysbenchLoggingArguments(SysbenchMode.Run);
this.sysbenchExecutionArguments = $"{this.sysbenchLoggingArguments} --workload {this.Workload} --hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}";

string script = $"{this.SysbenchPackagePath}/run-workload.py ";
string script = $"{this.SysbenchPackagePath}/run-workload.py ";

using (IProcessProxy process = await this.ExecuteCommandAsync(
SysbenchExecutor.PythonCommand,
script + this.sysbenchExecutionArguments,
this.SysbenchPackagePath,
telemetryContext,
cancellationToken))
{
if (!cancellationToken.IsCancellationRequested)
{
await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true);
process.ThrowIfErrored<WorkloadException>(process.StandardError.ToString(), ErrorReason.WorkloadFailed);
using (IProcessProxy process = await this.ExecuteCommandAsync(
SysbenchExecutor.PythonCommand,
script + this.sysbenchExecutionArguments,
this.SysbenchPackagePath,
telemetryContext,
cancellationToken))
{
if (!cancellationToken.IsCancellationRequested)
{
await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true);
process.ThrowIfErrored<WorkloadException>(process.StandardError.ToString(), ErrorReason.WorkloadFailed);

this.CaptureMetrics(process, telemetryContext, cancellationToken);
this.CaptureMetrics(process, telemetryContext, cancellationToken);
}
}
}
}
});
}
}
}
Loading
Loading