diff --git a/README.md b/README.md index 059b9c5..c2596b4 100644 --- a/README.md +++ b/README.md @@ -118,36 +118,39 @@ import ru.tinkoff.gatling.profile._ Using: -*resources/profile/sample_profile.conf* +*resources/profile.conf* ``` { - "profile": { - "name": "awesome_profile", - "requests": { - "awesome/url_1/": { - "method": "GET", - "url": "awesome/url_1/", - "prob": 33.33333 - }, - "awesome/url_1/sub_url_2": { - "method": "GET", - "url": "awesome/url_1/sub_url_2", - "prob": 66.66667 - } - } - } + "name": "awesome_profile", + "requests": [ + { + "request-name": "POST first", + "method": "POST", + "url": "awesome/url_1/", + "prob": 33.33333 + }, + { + "request-name": "GET second" + "method": "GET", + "url": "awesome/url_1/sub_url_2", + "prob": 66.66667 + } + ] } ``` + +*Simulation setUp* ```scala -val profileConfig: Config = ProfileConfigManager.profileConfigLoad(s"profile/sample_profile.conf") + val profileConfigName = "profile.conf" + val someTestPlan = constantUsersPerSec(intensity) during stageDuration + val httpProtocol = http.baseUrl(baseUrl) -setUp( - HttpProfile(profileConfig) + setUp( + HttpProfile(profileConfigName) .build() .inject(someTestPlan) - .protocols(someProtocol) - ) - + ).protocols(httpProtocol) + .maxDuration(testDuration) ``` ### templates diff --git a/src/main/scala/ru/tinkoff/gatling/profile/ProfileConfigManager.scala b/src/main/scala/ru/tinkoff/gatling/profile/ProfileConfigManager.scala deleted file mode 100644 index a765538..0000000 --- a/src/main/scala/ru/tinkoff/gatling/profile/ProfileConfigManager.scala +++ /dev/null @@ -1,11 +0,0 @@ -package ru.tinkoff.gatling.profile - -import com.typesafe.config.{Config, ConfigFactory} -import io.gatling.core.Predef.configuration - -object ProfileConfigManager { - - def profileConfigLoad(profilePath: String = "default-profile.conf"): Config = configuration.config - .withFallback(ConfigFactory.load(profilePath).getConfig("profile")) - -}