玩转----jmeter函数助手
##常用函数的介绍
__time 函数
获取系统的当前时间 
| 函数参数 | 描述 |
|---|---|
| Format string for SimpleDateFormat (optional)格式 | 设置时间所采用的格式 |
| Name of variable in which to store the result (optional)变量名 | 存储结果的变量名称 |
如果省略了格式字符串,time函数会返回当前时间的毫秒级时间戳。 time函数包含以下时间格式
- YMD = yyyyMMdd。

- HMS = HHmmss。

- YMDHMS = yyyyMMdd-HHmmss。

- 也可以加入字符修改样式

- 用户可以通过修改JMeter属性来改变默认格式,例如,time.YMD=yyMMdd。
time毫秒时间戳转秒时间戳 
__Random 函数
生成随机数
| 函数参数 | 描述 |
|---|---|
| FThe minimum value allowed for a range of value | 随机数取值范围的最小值 |
| The maximum value allowed for a range of values | 取值范围的最大值 |
| Name of variable in which to store the result (optional) | 存储结果的变量名称 |
- 在1000-10000之间生成随机数

__RandomString
随机生成字符串
| 函数参数 | 描述 |
|---|---|
| Random string length | 随机字符串的长度 |
| Chars to use for random string generation | 用来生成随机字符串的字符 |
| Name of variable in which to store the result (optional) | 存储结果的变量名称 |
__RandomDate
随机生成日期
| 函数参数 | 描述 |
|---|---|
| Format string for DateTimeFormatter (optional) (default yyyy-MM-dd) | 日期格式 默认yyyy-mm-dd |
| Start date (optional) (default: now) | 随机日期的开始日期,默认为现在 |
| End date | 结束日期 |
| String format of a locale (ex: fr_FR , en_EN) (optional) | 语言区域 |
| Name of variable in which to store the result (optional) | 存储结果的变量名称 |

__threadNum
返回当前线程的编号





浙公网安备 33010602011771号