In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use the timestamp function in jmeter, which has a certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article.
When using jmeter for interface testing, the function of date is often used to let the system automatically generate some formatted data to facilitate interface testing. Jmeter itself is a function with a timestamp.
1. _ _ time: get the timestamp and format time
(1), ${_ _ time (yyyy-MM-dd HH:mm:ss:SSS,time)}: formatted generation time format 2018-10-26 11 purl 08 purl 23 purve635
(2), ${_ _ time (,)}: by default, the formula is accurate to the millisecond level, 13 digits 1527822855323
(3), ${_ _ time (/ 1000,)}: the formula is accurate to the second level, 10 digits 1527822871
(4), ${_ _ time (yyyy-MM-dd,)}: the formatting time of the formula is 2018-10-26.
(5), ${_ _ time (yyMMdd,)}: the formatting time of the formula is: 181026
2. _ _ timeShift (format, date, shift, locale, variable) function, which can shift the time to increase or decrease the corresponding time for the current time.
(1), format-displays the format of the creation date. If the value is not passed, the date is created in milliseconds.
(2) date-this is the date value. Used if you want to create a specific date by adding or subtracting a specific number of days, hours, or minutes. If the parameter value fails, the current date is used.
(3) shift-indicates how many days, hours, or minutes to add or subtract from the value of the date parameter. If the value is not passed, no value is subtracted or added to the value of the date parameter.
"P1DT2H4M5S" is parsed as "add 1 day, 2 hours, 4 minutes, 5 seconds"
"P-6H3M" is parsed as "- 6 hours + 3 minutes"
"- P6H3M" is parsed as "- 6 hours-3 minutes"
"- Pmur6H + 3M" is parsed as "+ 6 hours and-3 minutes"
(4), locale-sets the display language for the creation date. Not required
Variable-the name of the variable to which the value of the creation date will be assigned. Not required
E.g.Vue ${_ _ timeShift (yy-MM-dd,2018-10-26 recorder P2D,)} the return time is 2018-10-28.
3. _ _ randomDate (format, start time, end time): get the time randomly within the time period
(1) the format defaults to yyyy-MM-dd
E.g. randomDate ${_ _ randomDate (2018-10-30)}, this function automatically returns a date between 20181001 and 20181030.
Thank you for reading this article carefully. I hope the article "how to use the timestamp function in jmeter" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.