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 @@ -59,9 +59,9 @@ public async Task SysbenchOLTPWorkloadProfileExecutesTheExpectedWorkloadsOnUnixP

string scriptPath = this.mockFixture.PlatformSpecifics.GetScriptPath("sysbencholtp");

string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balancedClient.sh");
string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balancedServer.sh");
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "inMemory.sh");
string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-Client.sh");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could help do me a favor, make it all lower cased

string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-Server.sh");
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "in-Memory.sh");

this.mockFixture.SetupFile(balancedServerScript);
this.mockFixture.SetupFile(balancedClientScript);
Expand Down Expand Up @@ -93,9 +93,9 @@ private IEnumerable<string> GetProfileExpectedCommands(PlatformID platform, Arch
{
"git clone https://github.com/akopytov/sysbench.git /home/user/tools/VirtualClient/packages/sysbench",

$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balancedServer.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balancedClient.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/inMemory.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-Server.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-Client.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/in-Memory.sh\"",

"sudo ./autogen.sh",
"sudo ./configure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommand()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
Expand Down Expand Up @@ -152,6 +152,7 @@ public async Task SysbenchOLTPClientExecutorUsesDefinedParameters()

this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.Threads)] = "8";
this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.RecordCount)] = "1000";
this.mockFixture.Parameters[nameof(SysbenchOLTPClientExecutor.NumTables)] = "40";

this.mockFixture.StateManager.OnGetState().ReturnsAsync(JObject.FromObject(new SysbenchOLTPExecutor.SysbenchOLTPState()
{
Expand All @@ -161,16 +162,16 @@ public async Task SysbenchOLTPClientExecutorUsesDefinedParameters()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
"sudo make install",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=10 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=8 --tables=40 --table-size=1000 --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
};

int commandNumber = 0;
Expand Down Expand Up @@ -237,16 +238,16 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommandBalanc

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
"sudo make install",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo {this.scriptPath}/balancedClient.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
$"sudo {this.scriptPath}/balanced-Client.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
};

Expand Down Expand Up @@ -295,9 +296,9 @@ public async Task SysbenchOLTPClientExecutorSkipsInitializationOfTheWorkloadForE

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
Expand Down Expand Up @@ -361,9 +362,9 @@ public async Task SysbenchOLTPClientExecutorSkipsPrepareAndCleanupSteps()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balancedClient.sh\"",
$"sudo chmod +x \"{this.scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public async Task SysbenchOLTPServerExecutorExcutesExpectedProcessInMemoryScenar

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedClient.sh\"",
$"sudo {scriptPath}/inMemory.sh 8192"
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/in-Memory.sh 8192"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down Expand Up @@ -126,10 +126,10 @@ public async Task SysbenchOLTPServerExecutorExcutesExpectedProcessBalancedScenar

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedClient.sh\"",
$"sudo {scriptPath}/balancedServer.sh {mountPaths}"
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/balanced-Server.sh {mountPaths}"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down Expand Up @@ -170,10 +170,10 @@ public async Task SysbenchOLTPServerExecutorDoesNotExecuteBalancedScenarioOnInit

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/inMemory.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedServer.sh\"",
$"sudo chmod +x \"{scriptPath}/balancedClient.sh\"",
$"sudo {scriptPath}/balancedServer.sh"
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/balanced-Server.sh"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ public string Workload
}
}

/// <summary>
/// The workload option passed to Sysbench.
/// </summary>
public string NumTables
{
get
{
return this.Parameters.GetValue<string>(nameof(SysbenchOLTPClientExecutor.NumTables), 10);
}
}

/// <summary>
/// Number of records per table.
/// </summary>
Expand Down Expand Up @@ -217,8 +228,8 @@ protected override async Task InitializeAsync(EventContext telemetryContext, Can

// set arguments & path up based on prepare arguments in profile

this.sysbenchPrepareArguments = $@"oltp_common --tables=10 --table-size={this.RecordCount} --mysql-db={this.DatabaseName} --mysql-host={this.ServerIpAddress} prepare";
this.sysbenchLoggingArguments = $"{this.Workload} --threads={this.Threads} --tables=10 --table-size={this.RecordCount} --mysql-db={this.DatabaseName} ";
this.sysbenchPrepareArguments = $@"oltp_common --tables={this.NumTables} --table-size={this.RecordCount} --mysql-db={this.DatabaseName} --mysql-host={this.ServerIpAddress} prepare";
this.sysbenchLoggingArguments = $"{this.Workload} --threads={this.Threads} --tables={this.NumTables} --table-size={this.RecordCount} --mysql-db={this.DatabaseName} ";
this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--mysql-host={this.ServerIpAddress} --time={this.DurationSecs} ";
this.sysbenchPath = this.PlatformSpecifics.Combine(this.sysbenchDirectory, SysbenchOLTPClientExecutor.SysbenchFileName);
}
Expand All @@ -238,7 +249,7 @@ private void CaptureMetrics(IProcessProxy process, EventContext telemetryContext

this.Logger.LogMetrics(
toolName: "Sysbench",
scenarioName: "OLTP",
scenarioName: "OLTP " + this.Scenario,
process.StartTime,
process.ExitTime,
metrics,
Expand Down Expand Up @@ -339,7 +350,7 @@ private async Task PrepareMySQLDatabase(EventContext telemetryContext, Cancellat

await this.ExecuteCommandAsync<SysbenchOLTPClientExecutor>(this.sysbenchPath, this.sysbenchExecutionArguments + "cleanup", this.sysbenchDirectory, cancellationToken)
.ConfigureAwait(false);

await this.ExecuteCommandAsync<SysbenchOLTPClientExecutor>(this.sysbenchPath, this.sysbenchPrepareArguments, this.sysbenchDirectory, cancellationToken)
.ConfigureAwait(false);

Expand Down Expand Up @@ -373,7 +384,7 @@ private async Task PrepareBalancedScenarioAsync(string diskPaths, EventContext t
// client work in the balanced scenario includes copying all tables from OS disk to data disk,
// dropping old tables & renaming them

string balancedScript = "balancedClient.sh";
string balancedScript = "balanced-Client.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");
string balancedArguments = $"{this.ServerIpAddress} 10 {this.DatabaseName} {diskPaths}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ protected async Task InitializeExecutablesAsync(CancellationToken cancellationTo
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "balancedServer.sh"),
this.Combine(scriptsDirectory, "balanced-Server.sh"),
this.Platform,
cancellationToken);

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "balancedClient.sh"),
this.Combine(scriptsDirectory, "balanced-Client.sh"),
this.Platform,
cancellationToken);

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "inMemory.sh"),
this.Combine(scriptsDirectory, "in-Memory.sh"),
this.Platform,
cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task PrepareInMemoryScenarioAsync(EventContext telemetryContext, C
{
// server's job is to configure buffer size, in memory script updates the mysql config file

string inMemoryScript = "inMemory.sh";
string inMemoryScript = "in-Memory.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

MemoryInfo memoryInfo = await this.SystemManager.GetMemoryInfoAsync(cancellationToken);
Expand Down Expand Up @@ -217,7 +217,7 @@ private async Task<string> PrepareBalancedScenarioAsync(EventContext telemetryCo
}
}

string balancedScript = "balancedServer.sh";
string balancedScript = "balanced-Server.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

using (IProcessProxy process = await this.ExecuteCommandAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
<ScriptFiles Include="SysbenchOLTP\*.sh" />
</ItemGroup>

<ItemGroup>
<ScriptFiles Remove="SysbenchOLTP\balanced-Client.sh" />
<ScriptFiles Remove="SysbenchOLTP\balanced-Server.sh" />
<ScriptFiles Remove="SysbenchOLTP\in-Memory.sh" />
</ItemGroup>

<Target Name="CopyWorkloadScriptsToOutput" AfterTargets="Build">
<Message Importance="high" Text="Publish workload scripts/content..." />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ public string Action
}
}

/// <summary>
/// The specifed action that controls the execution of the dependency.
/// </summary>
public bool SkipInitialize
{
get
{
return this.Parameters.GetValue<bool>(nameof(this.SkipInitialize), false);
}
}

/// <summary>
/// The name to use for the MySQL Database to manage.
/// </summary>
Expand All @@ -74,7 +85,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel

telemetryContext.AddContext(nameof(configurationState), configurationState);

if (configurationState == null)
if (configurationState == null && !this.SkipInitialize)
{
switch (this.Action)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"Parameters": {
"DatabaseName": "sbtest",
"DatabaseScenario": "Default"
"DatabaseScenario": "Default",
"SkipInitialize": false
},
"Actions": [
{
Expand Down Expand Up @@ -67,6 +68,7 @@
"Scenario": "ConfigureMySQLServer",
"Action": "StartServer",
"DatabaseName": "$.Parameters.DatabaseName",
"SkipInitialize": "$.Parameters.SkipInitialize",
"Role": "Server"
}
},
Expand All @@ -75,7 +77,8 @@
"Parameters": {
"Scenario": "CreateMySQLDatabase",
"Action": "CreateDatabase",
"DatabaseName": "$.Parameters.DatabaseName",
"DatabaseName": "$.Parameters.DatabaseName",
"SkipInitialize": "$.Parameters.SkipInitialize",
"Role": "Server"
}
},
Expand All @@ -85,6 +88,7 @@
"Scenario": "ConfigureMySQLDatabase",
"Action": "RaisedStatementCount",
"DatabaseName": "$.Parameters.DatabaseName",
"SkipInitialize": "$.Parameters.SkipInitialize",
"Role": "Server"
}
},
Expand All @@ -94,6 +98,7 @@
"Scenario": "ConfigureMySQLServer",
"Action": "ConfigureNetwork",
"DatabaseName": "$.Parameters.DatabaseName",
"SkipInitialize": "$.Parameters.SkipInitialize",
"Role": "Server"
}
},
Expand All @@ -103,6 +108,7 @@
"Scenario": "ConfigureMySQLDatabase",
"Action": "CreateUser",
"DatabaseName": "$.Parameters.DatabaseName",
"SkipInitialize": "$.Parameters.SkipInitialize",
"Role": "Server"
}
},
Expand Down