- load test
"soak-cluster1"
(globalVars:[
"numThreads"
=
"THREADS_COUNT"
,
"rampUpTime"
=
"RAMPUP_TIME"
,
"ctrlLoops"
=
"CTRL_LOOPS"
,
"apiKey"
=
"API_KEY"
,
"csvFileHost"
=
"DOMAIN_FILE"
,
"ipAddressRequest"
=
"ipAddress_FILE"
,
"DATA_DIR"
=
"/Users/ashok/sunbird-perf-tests/sunbird-platform/soak-cluster1"
,
"deviceidRequest"
=
"deviceId_FILE"
],
executeTearDownThreadsOnShutdown: true)
Comments:
-
- set variables for thread
"User Parameters"
(names=[
"uuid"
],values=[
"${__UUID()}"
]
)
- run
"Thread Group - SendTelemetry"
(
threads: "${numThreads}",
loops: "${ctrlLoops}",
ramp-up: "${rampUpTime}"
)
-
- http request
"SendTelemetry"
(method: "POST",
url: "
${protocol}://${host}:${port}//api/data/v1/telemetry",
body: [
]
,
upload-files: [
{param="",
path="${DATA_DIR}/telemetry-23kb-to-3kb.json.gz",
mime-type="application/gzip"}
]
)
-
- add headers
"HTTP Header Manager"
(headers:[
{"Content-Type"=
"application/json"
,
{"Authorization"=
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJMb2FkVGVzdERldmljZUEyLTI1MzQifQ.oO0cTTtWrLzElk-8KBag_T7-KX3lywGMrl5xyqeCSYw"
,
{"Content-Encoding"=
"gzip"
,
{"Accept-Encoding"=
"gzip, deflate"
])
- run
"Thread Group - device-profile"
(
threads: "${numThreads}",
loops: "${ctrlLoops}",
ramp-up: "${rampUpTime}"
)
-
- http request
"device-profile"
(method: "GET",
url: "
${protocol}://${host}:${port}//api/v3/device/profile/${deviceId}",
body: [
]
,
upload-files: [
]
)
-
- add headers
"HTTP Header Manager"
(headers:[
{"Content-Type"=
"application/json"
,
{"X-Real-IP"=
"${ipAddress}"
,
{"Authorization"=
"Bearer ${apiKey}"
,
{"Accept-Encoding"=
"gzip, deflate"
])
- run
"Thread Group - device-register"
(
threads: "${numThreads}",
loops: "${ctrlLoops}",
ramp-up: "${rampUpTime}"
)
-
- http request
"device-register"
(method: "POST",
url: "
${protocol}://${host}:${port}//api/v3/device/register/${deviceId}",
body: "{
"id": "preprod.diksha.portal",
"ver": "2.6.5",
"ts": "${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)}",
"params": {
"msgid": "a1687e7f-ede7-e433-f6a6-18a18333e7ff"
},
"request": {
"did": "${deviceId}",
"producer": "preprod.diksha.portal",
"uaspec": {
"agent": "Chrome",
"ver": "79.0.3945.74",
"system": "mac-os-x-15",
"platform": "Mac",
"raw": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/79.0.3945.74 Safari/537.36"
},
"userDeclaredLocation": {
"state": "Karnataka",
"district": "Belagavi"
}
}
}
"
,
upload-files: [
]
)
-
- add headers
"HTTP Header Manager"
(headers:[
{"Content-Type"=
"application/json"
,
{"X-Real-IP"=
"${ipAddress}"
,
{"Authorization"=
"Bearer ${apiKey}"
,
{"Accept-Encoding"=
"gzip, deflate"
])
- run
"Thread Group - PageAssemble"
(
threads: "${numThreads}",
loops: "${ctrlLoops}",
ramp-up: "${rampUpTime}"
)
-
- http request
"PageAssemble"
(method: "POST",
url: "
${protocol}://${host}:${port}//api/data/v1/page/assemble?orgdetails=orgName",
body: "{"request":{"name":"Course","filters":{},"source":"app","from":"cache"}}"
,
upload-files: [
]
)
-
- add headers
"HTTP Header Manager"
(headers:[
{"Content-Type"=
"application/json"
,
{"Accept-Encoding"=
"gzip,deflate,sdch"
,
{"Authorization"=
"Bearer ${apiKey}"
,
{"Accept-Encoding"=
"gzip, deflate"
])
- run
"Thread Group - consumer-mobile-device-register"
(
threads: "${numThreads}",
loops: "${ctrlLoops}",
ramp-up: "${rampUpTime}"
)
-
- http request
"consumer-mobile-device-register"
(method: "POST",
url: "
${protocol}://${host}:${port}//api/api-manager/v2/consumer/mobile_device/credential/register",
body: "{
"id": "ekstep.genie.device.register",
"ver": "1.0",
"ts": "2020-03-17T22:24:31+05:30",
"request": {
"key": "loadtest.sunbird.app-a8cbcf6fb7fc86780d82783a906afd614cc57b08"
}
}"
,
upload-files: [
]
)
-
- add headers
"HTTP Header Manager"
(headers:[
{"X-Device-Id"=
"${uuid}"
,
{"Content-Encoding"=
"gzip"
,
{"Accept-Charset"=
"UTF-8"
,
{"Accept"=
"application/json"
,
{"Access-Control-Allow-Origin"=
"*"
,
{"Authorization"=
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdW5iaXJkLTEuMCJ9.hupJSdO54Cz47nB3PQb0Sp0wWFF2rC_SRTWUihQLWgM"
,
{"X-App-Id"=
"loadtest.sunbird.app"
,
{"X-Channel-Id"=
"505c7c48ac6dc1edc9b08f21db5a571d"
,
{"Content-Type"=
"application/json"
,
{"Accept-Encoding"=
"gzip, deflate"
,
{"User-Agent"=
"Dalvik/2.1.0 (Linux; U; Android 6.0; XT1068 Build/MPB24.65-34-3)"
])
- read csv into vars
"CSV Data Set Config"
(file: "${csvFileHost}",
vars:"protocol,host,port",
sharing:"shareMode.all",
recycleOnEof:true,
stopThreadOnEof:false
)
- read csv into vars
"CSV Data Set Config"
(file: "${ipAddressRequest}",
vars:"ipAddress",
sharing:"shareMode.all",
recycleOnEof:true,
stopThreadOnEof:false
)
- read csv into vars
"CSV Data Set Config"
(file: "${deviceidRequest}",
vars:"deviceId",
sharing:"shareMode.all",
recycleOnEof:true,
stopThreadOnEof:false
)
- write samples
"Summary Report"
- write samples
"View Results Tree"