diff --git a/.gitignore b/.gitignore index 53c4b7d..ec4d461 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /target/ /logs/*.log /iroha2-per.iml -/src/mint_asset_for_created_user_trigger/target/ \ No newline at end of file +/src/mint_asset_for_created_user_trigger/target/ +/iroha2-perf.iml \ No newline at end of file diff --git a/src/main/java/jp/co/soramitsu/load/LoadProfiles.java b/src/main/java/jp/co/soramitsu/load/LoadProfiles.java index 11e6f3d..37a8680 100644 --- a/src/main/java/jp/co/soramitsu/load/LoadProfiles.java +++ b/src/main/java/jp/co/soramitsu/load/LoadProfiles.java @@ -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()), @@ -43,4 +59,5 @@ public static OpenInjectionStep[] setupModel(){ atOnceUsers(SimulationConfig.simulation.domainSetUpRumpUp()) }; } + } diff --git a/src/main/kotlin/jp/co/soramitsu/load/TechicalScns/TransactionOnly.kt b/src/main/kotlin/jp/co/soramitsu/load/TechicalScns/TransactionOnly.kt index 29583f0..31ee0b3 100644 --- a/src/main/kotlin/jp/co/soramitsu/load/TechicalScns/TransactionOnly.kt +++ b/src/main/kotlin/jp/co/soramitsu/load/TechicalScns/TransactionOnly.kt @@ -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 @@ -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", diff --git a/src/test/java/jp/co/soramitsu/load/simulation/transaction/PerformanceSimulation.java b/src/test/java/jp/co/soramitsu/load/simulation/transaction/PerformanceSimulation.java index 0140822..14cb230 100644 --- a/src/test/java/jp/co/soramitsu/load/simulation/transaction/PerformanceSimulation.java +++ b/src/test/java/jp/co/soramitsu/load/simulation/transaction/PerformanceSimulation.java @@ -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); }