Skip to content

Commit

Permalink
Merge pull request #55 from soramitsu/fix/iroha_config
Browse files Browse the repository at this point in the history
update metrics
  • Loading branch information
timofeevmd authored Mar 19, 2024
2 parents 9f26cc6 + d77ff2a commit 4bc975e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/target/
/logs/*.log
/iroha2-per.iml
/src/mint_asset_for_created_user_trigger/target/
/src/mint_asset_for_created_user_trigger/target/
/iroha2-perf.iml
17 changes: 17 additions & 0 deletions src/main/java/jp/co/soramitsu/load/LoadProfiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,28 @@ public static ClosedInjectionStep getMaxPerformanceClosedProfile() {
.separatedByRampsLasting(SimulationConfig.simulation.separatedByRampsLasting())
.startingFrom(SimulationConfig.simulation.startingFrom());
}

public static OpenInjectionStep getMaxPerformanceOpenProfile() {
return incrementUsersPerSec(SimulationConfig.simulation.concurrentUsers())
.times(SimulationConfig.simulation.times())
.eachLevelLasting(SimulationConfig.simulation.stageDuration())
.separatedByRampsLasting(SimulationConfig.simulation.rampDuration())
.startingFrom(0);
}

public static ClosedInjectionStep[] getStabilityClosedProfile() {
return new ClosedInjectionStep[]{
rampConcurrentUsers(0).to(SimulationConfig.simulation.intensity()).during(SimulationConfig.simulation.rampDuration()),
constantConcurrentUsers(SimulationConfig.simulation.intensity()).during(SimulationConfig.simulation.stageDuration())
};
}

public static OpenInjectionStep[] getStabilityOpenProfile() {
return new OpenInjectionStep[]{
constantUsersPerSec(SimulationConfig.simulation.intensity()).during(SimulationConfig.simulation.stageDuration())
};
}

public static ClosedInjectionStep[] getStressClosedProfile() {
return new ClosedInjectionStep[]{
rampConcurrentUsers(0).to(SimulationConfig.simulation.intensity()).during(SimulationConfig.simulation.rampDuration()),
Expand All @@ -43,4 +59,5 @@ public static OpenInjectionStep[] setupModel(){
atOnceUsers(SimulationConfig.simulation.domainSetUpRumpUp())
};
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package jp.co.soramitsu.load.TechicalScns

import io.gatling.javaapi.core.CoreDsl
import io.gatling.javaapi.core.ScenarioBuilder
import io.prometheus.client.Histogram
import jp.co.soramitsu.iroha2.client.blockstream.BlockStreamStorage
import jp.co.soramitsu.iroha2.client.blockstream.BlockStreamSubscription
import jp.co.soramitsu.load.infrastructure.config.SimulationConfig
Expand Down Expand Up @@ -42,6 +43,7 @@ class TransactionOnly: Wrench13() {
Session
}
.exec { Session ->
var timer: Histogram.Timer
val iroha2Client = buildClient(SimulationConfig.simulation.configuration())
timer = CustomMetrics.subscriptionToBlockStreamTimer.labels(
"gatling",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public class PerformanceSimulation extends Simulation {
{
setUp(
jp.co.soramitsu.load.SetUp.Companion.apply().injectOpen(OpenInjectionStep.atOnceUsers(1))
.andThen(TransferAssets.Companion.apply().injectClosed(LoadProfiles.getMaxPerformanceClosedProfile()))
//.andThen(TransferAssets.Companion.apply().injectClosed(LoadProfiles.getMaxPerformanceClosedProfile()))
.andThen(TransferAssets.Companion.apply().injectOpen(LoadProfiles.getStabilityOpenProfile()))
.andThen(CleanUp.Companion.apply().injectOpen(OpenInjectionStep.atOnceUsers(1)))
).protocols(Protocols.httpProtocol);
}
Expand Down

0 comments on commit 4bc975e

Please sign in to comment.