Skip to content

Commit

Permalink
Merge pull request #58 from soramitsu/fix/iroha_config
Browse files Browse the repository at this point in the history
update load model
  • Loading branch information
adaagava authored Mar 19, 2024
2 parents 73e3af6 + 2e2b5ca commit 04505e0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 44 deletions.
84 changes: 42 additions & 42 deletions src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,35 @@ class TransferAssets : Wrench13() {
}
.exec { Session ->
runBlocking {
var timer: Histogram.Timer
//var timer: Histogram.Timer
val iroha2Client = buildClient(SimulationConfig.simulation.configuration())
timer = CustomMetrics.subscriptionToBlockStreamTimer.labels(
"gatling",
System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
Iroha2SetUp::class.simpleName
).startTimer()
val idToSubscription = iroha2Client.subscribeToBlockStream(1, 2)
val subscription = idToSubscription.second
timer.observeDuration()
CustomMetrics.subscriptionToBlockStreamCount.labels(
"gatling",
System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
Iroha2SetUp::class.simpleName
).inc()
sendMetricsToPrometheus(CustomMetrics.subscriptionToBlockStreamCount, "transaction")
sendMetricsToPrometheus(CustomMetrics.subscriptionToBlockStreamTimer, "transaction")
timer = CustomMetrics.transferAssetTimer.labels(
"gatling",
System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
Iroha2SetUp::class.simpleName
).startTimer()
CustomMetrics.transferAssetCount.labels(
"gatling",
System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
Iroha2SetUp::class.simpleName
).inc()
sendMetricsToPrometheus(CustomMetrics.transferAssetCount, "transaction")
try {
//timer = CustomMetrics.subscriptionToBlockStreamTimer.labels(
// "gatling",
// System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
// Iroha2SetUp::class.simpleName
//).startTimer()
/* val idToSubscription = iroha2Client.subscribeToBlockStream(1, 2)
val subscription = idToSubscription.second*/
//timer.observeDuration()
//CustomMetrics.subscriptionToBlockStreamCount.labels(
// "gatling",
// System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
// Iroha2SetUp::class.simpleName
//).inc()
//sendMetricsToPrometheus(CustomMetrics.subscriptionToBlockStreamCount, "transaction")
//sendMetricsToPrometheus(CustomMetrics.subscriptionToBlockStreamTimer, "transaction")
//timer = CustomMetrics.transferAssetTimer.labels(
// "gatling",
// System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
// Iroha2SetUp::class.simpleName
//).startTimer()
//CustomMetrics.transferAssetCount.labels(
// "gatling",
// System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
// Iroha2SetUp::class.simpleName
//).inc()
//sendMetricsToPrometheus(CustomMetrics.transferAssetCount, "transaction")
//try {
iroha2Client.sendTransaction {
account(anotherDevAccountIdSender)
transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver)
Expand All @@ -85,20 +85,20 @@ class TransferAssets : Wrench13() {
pliers.healthCheck(true, "TransferAssets")
}
}*/
subscription.stop()
} catch (ex: RuntimeException) {
CustomMetrics.transferAssetErrorCount.labels(
"gatling",
System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
Iroha2SetUp::class.simpleName
).inc()
sendMetricsToPrometheus(CustomMetrics.transferAssetErrorCount, "transaction")
println("Something went wrong on TransferAssets scenario, problem with transfer asset transaction: " + ex.message)
pliers.healthCheck(false, "TransferAssets")
} finally {
timer.observeDuration()
sendMetricsToPrometheus(CustomMetrics.transferAssetTimer, "transaction")
}
//subscription.stop()
//} catch (ex: RuntimeException) {
// CustomMetrics.transferAssetErrorCount.labels(
// "gatling",
// System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"),
// Iroha2SetUp::class.simpleName
// ).inc()
// sendMetricsToPrometheus(CustomMetrics.transferAssetErrorCount, "transaction")
// println("Something went wrong on TransferAssets scenario, problem with transfer asset transaction: " + ex.message)
// pliers.healthCheck(false, "TransferAssets")
//} finally {
// timer.observeDuration()
// sendMetricsToPrometheus(CustomMetrics.transferAssetTimer, "transaction")
//}
}
Session
}
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/jp/co/soramitsu/load/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public static void main(String[] args) {
.resourcesDirectory(IDEPathHelper.mavenResourcesDirectory.toString())
.resultsDirectory(IDEPathHelper.resultsDirectory.toString())
.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString())
.simulationClass(SimulationConfig.simulation.loadSimulation());
//.simulationClass(SimulationConfig.simulation.loadSimulation());
.simulationClass(SimulationConfig.simulation.maximumSearchSimulation());
Gatling.fromMap(props.build());
}
}
2 changes: 1 addition & 1 deletion src/test/resources/simulation.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ duringSetUp=0
setUpUsersOnEachDomain=3

#Load model + Stress model
intensity=1
intensity=10
rampDuration=2
stageDuration=600
stressIntensity=20
Expand Down

0 comments on commit 04505e0

Please sign in to comment.