The location of the target object needs to be randomly generated in the Post interface:
So the JavaScript function is used as follows:
{
"Location": {
"Altitude": ${__random (100000,1000000)},
"Latitude": ${__javascript (Math.random () * 0.05 + 27.57455455701666)},
"Longitude": ${__javascript (Math.random () * 0.05 + 110.20559185114483)},
"UTC": ${__time (/1000,)}
},
"Targetid": "1000",
"TargetType": 1000
}
The interface does the pressure measurement, found that the performance is very poor, the latitude and longitude parameter values into a fixed value, found that the performance and return to normal level; later replaced by CSV file, import random location, performance also restored normal level, the main is the JavaScript function affects the interface request performance, But the following method is OK:
{
"Location": {
"Altitude": ${__random (100000,1000000)},
"Latitude": ${__random (27,34)}.${__random (1,9999999999)},
"Longitude": ${__random (115,134)}.${__random (1,9999999999)},
"UTC": ${__time (/1000,)}
},
"Targetid": "1000",
"TargetType": 1000
}
Two ${__random (,,)} in the middle plus characters. Can realize the random generation of floating-point number,??
jmeter--randomly generated floating-point numbers