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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedWorkloadCommand()
{
SetupDefaultBehavior();

string expectedCommand = @$"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 1000 --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 OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --workload oltp_read_write --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 @@ -136,7 +136,7 @@ public async Task SysbenchClientExecutorUsesDefinedParametersWhenRunningTheWorkl
this.fixture.Parameters[nameof(SysbenchClientExecutor.TableCount)] = "40";
this.fixture.Parameters[nameof(SysbenchClientExecutor.DatabaseScenario)] = "Configure";

string expectedCommand = @$"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --workload oltp_read_write --threadCount 64 --tableCount 40 --recordCount 1000 --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 OLTP --tableCount 40 --recordCount 1000 --threadCount 64 --workload oltp_read_write --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 @@ -179,7 +179,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedBalancedScenario()

this.fixture.Parameters[nameof(SysbenchClientExecutor.DatabaseScenario)] = "Balanced";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 1000 --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 OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --workload oltp_read_write --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 @@ -222,7 +222,7 @@ public async Task SysbenchClientExecutorRunsInMemoryScenario()

this.fixture.Parameters[nameof(SysbenchClientExecutor.DatabaseScenario)] = "InMemory";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 100000 --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 OLTP --tableCount 10 --recordCount 100000 --threadCount 8 --workload oltp_read_write --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 @@ -265,7 +265,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedTPCCWorkloadCommand()

this.fixture.Parameters[nameof(SysbenchClientExecutor.Benchmark)] = "TPCC";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --workload tpcc --threadCount 8 --tableCount 10 --warehouses 100 --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 --tableCount 10 --warehouses 100 --threadCount 8 --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 @@ -308,7 +308,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedPostgreSQLOLTPWorkloadCom

this.fixture.Parameters[nameof(SysbenchClientExecutor.DatabaseSystem)] = "PostgreSQL";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 1000 --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 OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --workload oltp_read_write --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 @@ -352,7 +352,7 @@ public async Task SysbenchClientExecutorRunsTheExpectedPostgreSQLTPCCWorkloadCom
this.fixture.Parameters[nameof(SysbenchClientExecutor.DatabaseSystem)] = "PostgreSQL";
this.fixture.Parameters[nameof(SysbenchClientExecutor.Benchmark)] = "TPCC";

string expectedCommand = $"python3 {this.mockPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --workload tpcc --threadCount 8 --tableCount 10 --warehouses 100 --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 --tableCount 10 --warehouses 100 --threadCount 8 --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 @@ -77,7 +77,7 @@ public async Task SysbenchConfigurationSkipsSysbenchInitialization()

string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 8 --tableCount 10 --recordCount 1000 --password [A-Za-z0-9+/=]+",
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --password [A-Za-z0-9+/=]+",
};

int commandNumber = 0;
Expand Down Expand Up @@ -122,7 +122,7 @@ public async Task SysbenchConfigurationPreparesDatabase()
string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath {this.mockPackagePath}",
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 8 --tableCount 10 --recordCount 1000 --password [A-Za-z0-9+/=]+",
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --password [A-Za-z0-9+/=]+",
};

int commandNumber = 0;
Expand Down Expand Up @@ -173,7 +173,7 @@ public async Task SysbenchConfigurationUsesDefinedParametersWhenRunningTheWorklo
string[] expectedCommands =
{
$"python3 {this.mockPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath {this.mockPackagePath}",
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 16 --tableCount 40 --recordCount 1000 --password [A-Za-z0-9+/=]+",
$"python3 {this.mockPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 40 --recordCount 1000 --threadCount 16 --password [A-Za-z0-9+/=]+",
};

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

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

int commandNumber = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ private Task ExecuteWorkloadAsync(EventContext telemetryContext, CancellationTok

private async Task RunOLTPWorkloadAsync(EventContext telemetryContext, CancellationToken cancellationToken)
{
int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount);

this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload {this.Workload} --threadCount {threadCount} --tableCount {tableCount} --recordCount {recordCount} ";
this.sysbenchLoggingArguments = $"{this.BuildSysbenchLoggingOLTPBasicArguments()} --workload {this.Workload} ";
this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}";

string script = $"{this.SysbenchPackagePath}/run-workload.py ";
Expand Down Expand Up @@ -289,7 +285,7 @@ private async Task RunTPCCWorkloadAsync(EventContext telemetryContext, Cancellat
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
int warehouseCount = GetWarehouseCount(this.DatabaseScenario, this.WarehouseCount);

this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload tpcc --threadCount {threadCount} --tableCount {tableCount} --warehouses {warehouseCount} ";
this.sysbenchLoggingArguments = $"{this.BuildSysbenchLoggingTPCCBasicArguments()} --workload tpcc ";
this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}";

string script = $"{this.SysbenchPackagePath}/run-workload.py ";
Expand Down Expand Up @@ -338,11 +334,8 @@ private async Task TruncateMySQLDatabaseAsync(EventContext telemetryContext, Can

private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, CancellationToken cancellationToken)
{
int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount);
this.sysbenchLoggingArguments = this.BuildSysbenchLoggingOLTPBasicArguments();

this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --threadCount {threadCount} --tableCount {tableCount} --recordCount {recordCount}";
this.sysbenchPrepareArguments = $"{this.sysbenchLoggingArguments} --password {this.SuperUserPassword}";

string serverIp = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty<ClientInstance>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ await this.Logger.LogMessageAsync($"{this.TypeName}.PopulateDatabase", telemetry

private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, CancellationToken cancellationToken)
{
int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount);
string sysbenchLoggingArguments = this.BuildSysbenchLoggingOLTPBasicArguments();

string sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --threadCount {threadCount} --tableCount {tableCount} --recordCount {recordCount}";
this.sysbenchPrepareArguments = $"{sysbenchLoggingArguments} --password {this.SuperUserPassword}";

string serverIp = "localhost";
Expand Down Expand Up @@ -107,11 +104,7 @@ private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, Cance

private async Task PrepareTPCCMySQLDatabase(EventContext telemetryContext, CancellationToken cancellationToken)
{
int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
int warehouseCount = GetWarehouseCount(this.DatabaseScenario, this.WarehouseCount);

string sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --warehouses {warehouseCount} --threadCount {threadCount}";
string sysbenchLoggingArguments = this.BuildSysbenchLoggingTPCCBasicArguments();
this.sysbenchPrepareArguments = $"{sysbenchLoggingArguments} --password {this.SuperUserPassword}";

string arguments = $"{this.SysbenchPackagePath}/populate-database.py ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,42 @@ protected void AddMetric(string arguments, IProcessProxy process, EventContext t
}
}

/// <summary>
/// Build the Sysbench Logging Basic Arguments, having the common parameters
/// dbName, databaseSystem, benchmark and tableCount.
/// </summary>
/// <returns></returns>
protected string BuildSysbenchLoggingBasicArguments()
{
int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload);

return $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount}";
}

/// <summary>
/// Build the Sysbench Logging OLTP Basic Arguments, having the common parameters
/// dbName, databaseSystem, benchmark, tableCount, recordCount and threadCount.
/// </summary>
/// <returns></returns>
protected string BuildSysbenchLoggingOLTPBasicArguments()
{
int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
return $"{this.BuildSysbenchLoggingBasicArguments()} --recordCount {recordCount} --threadCount {threadCount}";
}

/// <summary>
/// Build the Sysbench Logging TPCC Basic Arguments, having the common parameters
/// dbName, databaseSystem, benchmark, tableCount, warehouses and threadCount.
/// </summary>
/// <returns></returns>
protected string BuildSysbenchLoggingTPCCBasicArguments()
{
int warehouseCount = GetWarehouseCount(this.DatabaseScenario, this.WarehouseCount);
int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads);
return $"{this.BuildSysbenchLoggingBasicArguments()} --warehouses {warehouseCount} --threadCount {threadCount}";
}

private async Task CheckDistroSupportAsync(EventContext telemetryContext, CancellationToken cancellationToken)
{
if (this.Platform == PlatformID.Unix)
Expand Down
Loading