Skip to content

Commit fd02853

Browse files
kayvontadjKayvon Tadj
andauthored
fixed 2 bugs and updated profile naming (#304)
Co-authored-by: Kayvon Tadj <[email protected]>
1 parent a1e4a85 commit fd02853

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/VirtualClient/VirtualClient.Actions.FunctionalTests/HammerDBProfileTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ private IEnumerable<string> GetUnixProfileExpectedCommands(bool singleVM)
239239

240240
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName hammerdbtest --directories {currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2; --password [A-Za-z0-9+/=]+",
241241

242+
$"python3 {this.hammerdbPackagePath}/configure-workload-generator.py --workload tpcc --sqlServer postgresql --port 5432 --virtualUsers [0-9]+ --warehouseCount [0-9]+ --password [A-Za-z0-9+/=]+ --dbName hammerdbtest --hostIPAddress",
243+
$"python3 {this.hammerdbPackagePath}/populate-database.py --createDBTCLPath createDB.tcl",
244+
242245
$"python3 {this.hammerdbPackagePath}/run-workload.py --runTransactionsTCLFilePath runTransactions.tcl",
243246
};
244247
}
@@ -273,6 +276,9 @@ private IEnumerable<string> GetWindowsProfileExpectedCommands(bool singleVM)
273276

274277
$"python3 {tempPostgreSqlPackagePath}/distribute-database.py --dbName hammerdbtest --directories E:\\\\;F:\\\\;G:\\\\; --password [A-Za-z0-9+/=]+",
275278

279+
$"python3 {temphammerdbPackagePath}/configure-workload-generator.py --workload tpcc --sqlServer postgresql --port 5432 --virtualUsers [0-9]+ --warehouseCount [0-9]+ --password [A-Za-z0-9+/=]+ --dbName hammerdbtest --hostIPAddress",
280+
$"python3 {this.hammerdbPackagePath}/populate-database.py --createDBTCLPath createDB.tcl",
281+
276282
$"python3 {this.hammerdbPackagePath}/run-workload.py --runTransactionsTCLFilePath runTransactions.tcl",
277283
};
278284
}

src/VirtualClient/VirtualClient.Actions/HammerDB/HammerDBExecutor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
198198
HammerDBState state = await this.stateManager.GetStateAsync<HammerDBState>(nameof(HammerDBState), cancellationToken)
199199
?? new HammerDBState();
200200

201-
if (!state.DatabaseCreated)
201+
if (state.DatabaseCreated != 2)
202202
{
203-
await this.Logger.LogMessageAsync($"{this.TypeName}.CreateDatabase", telemetryContext.Clone(), async () =>
203+
await this.Logger.LogMessageAsync($"{this.TypeName}.{this.Scenario}", telemetryContext.Clone(), async () =>
204204
{
205205
if (!cancellationToken.IsCancellationRequested)
206206
{
207207
await this.PrepareSQLDatabase(telemetryContext, cancellationToken);
208208
}
209209
});
210-
state.DatabaseCreated = true;
210+
state.DatabaseCreated++;
211211
await this.stateManager.SaveStateAsync<HammerDBState>(nameof(HammerDBState), state, cancellationToken);
212212
}
213213
}
@@ -399,11 +399,11 @@ public bool HammerDBInitialized
399399
}
400400
}
401401

402-
public bool DatabaseCreated
402+
public int DatabaseCreated
403403
{
404404
get
405405
{
406-
return this.Properties.GetValue<bool>(nameof(HammerDBState.DatabaseCreated), false);
406+
return this.Properties.GetValue<int>(nameof(HammerDBState.DatabaseCreated), 0);
407407
}
408408

409409
set

src/VirtualClient/VirtualClient.Main/profiles/PERF-POSTGRESQL-HAMMERDB-TPCC.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
{
111111
"Type": "HammerDBExecutor",
112112
"Parameters": {
113-
"Scenario": "PopulatePostgreSQLDatabase",
113+
"Scenario": "CreatePostgreSQLDatabase",
114114
"DatabaseName": "$.Parameters.DatabaseName",
115115
"Workload": "tpcc",
116116
"SQLServer": "postgresql",

0 commit comments

Comments
 (0)