This repository has been archived by the owner on Apr 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
ElasticSearch_PerformanceTests #11
Open
kapiljain786
wants to merge
11
commits into
master
Choose a base branch
from
ESPT
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4bdc0bb
Added extra config parameters to simualate real user conditions duri…
27ce73d
Added extra config parameters to simualate real user conditions duri…
a3bd088
Added extra config parameters to simualate real user conditions duri…
6daf565
Merge branch 'master' of github.com:hmcts/ccd-test-performance
26ecfa1
Doc Store Performance Test added
15a4e77
Ignore mac files and results
7e87c7e
added ES endpoint tests
74f8a73
Amended ES scenarion
2a3bc53
added conf for saat
mario-paniccia 90dbffc
upgraded to gatling 3
mario-paniccia 852e456
removed secrets
mario-paniccia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
*.iml | ||
.idea/* | ||
target/* | ||
|
||
results/ | ||
src.zip | ||
.DS_Store | ||
/gatling.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/test/scala/uk/gov/hmcts/ccd/corecasedata/scenarios/ESExactMatchYesOrNo.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object ESExactMatchYesOrNo extends PerformanceTestsConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you rename from ESExactMatchYesOrNo to SearchExactMatchYesOrNo |
||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("ESSearch") | ||
println("Elastic Search Exact Match on YesORNo field PT - URL: " + url) | ||
|
||
val ESExactMatchYesOrNoReqPayload = StringBody( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we just name this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar in other places |
||
""" | ||
{ | ||
"query":{ | ||
"bool":{ | ||
"filter":{ | ||
"match":{ | ||
"data.YesOrNoField":"Yes" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken(url) | ||
|
||
http("TX12_CCD_ElasticSearchEndpoint_ExactMatch_YesORNoField") | ||
.post(url) | ||
.queryParam("ctid", "AAT") | ||
.body( | ||
ESExactMatchYesOrNoReqPayload).asJSON | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
} | ||
|
||
println("ESExactMatchYesOrNo: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val ESExactMatchYesOrNoSCN = scenario("Elastic Search Exact Match on YesORNo Field").during(TotalRunDuration minutes) { | ||
exec( | ||
httpRequest() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
} |
50 changes: 50 additions & 0 deletions
50
src/test/scala/uk/gov/hmcts/ccd/corecasedata/scenarios/ESMatchAllCases.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object ESMatchAllCases extends PerformanceTestsConfig { | ||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("ESSearch") | ||
println("Elastic Search Match All & return 50 PT - URL: " + url) | ||
|
||
val ReqPayload = StringBody( | ||
""" | ||
{ | ||
"query": { | ||
"match_all": {} | ||
}, | ||
"size": 50 | ||
} | ||
""" | ||
) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken(url) | ||
|
||
http("TX11_CCD_ElasticSearchEndpoint_MatchAll_Return50Cases") | ||
.post(url) | ||
.queryParam("ctid", "AAT") | ||
.body( | ||
ReqPayload).asJSON | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
} | ||
|
||
println("ESMatchAllCases: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val ESMatchAll_Return50Cases = scenario("Elastic Search Match all and return 50 cases").during(TotalRunDuration minutes) { | ||
exec( | ||
httpRequest() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
} |
57 changes: 57 additions & 0 deletions
57
src/test/scala/uk/gov/hmcts/ccd/corecasedata/scenarios/ESSeachONTextArea.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object ESSeachONTextArea extends PerformanceTestsConfig { | ||
|
||
private val url: String = config.getString("caseDataUrl") + "/" + config.getString("ESSearch") | ||
println("Elastic Search on text area field PT - URL: " + url) | ||
|
||
val ESSeachONTextAreaReqPayload = StringBody( | ||
""" | ||
{ | ||
"query":{ | ||
"match_phrase_prefix":{ | ||
"data.TextAreaField":"Performance Testing " | ||
} | ||
}, | ||
"sort":[ | ||
{ | ||
"last_modified":"desc" | ||
}, | ||
"_score" | ||
] | ||
} | ||
""" | ||
) | ||
|
||
def httpRequest() = { | ||
val s2sToken = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken(url) | ||
|
||
http("TX14_CCD_ElasticSearchEndpoint_SearchONTextAreaField") | ||
.post(url) | ||
.queryParam("ctid", "AAT") | ||
.body( | ||
ESSeachONTextAreaReqPayload).asJSON | ||
.header("ServiceAuthorization", s2sToken) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status in (200)) | ||
} | ||
|
||
println("ESSeachONTextArea: Minimum think time " + MinThinkTime + " Maximum think time " + MaxThinkTime) | ||
|
||
val ESSeachONTextAreaSCN = scenario("Elastic Search on TextArea Field").during(TotalRunDuration minutes) { | ||
exec( | ||
httpRequest() | ||
) | ||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be called
searchUrl
instead ofESSearch