当前位置:网站首页>Tips for using BeanShell built-in variable prev
Tips for using BeanShell built-in variable prev
2022-07-24 05:17:00 【Agricultural garden】
1 prev brief introduction
BeanShell There are built-in variables ,JSR223 There will also be corresponding variables ;
prev Provides access to the current sampler results
prev mapping :org.apache.jmeter.samplers Of SampleResult class
Official documents :https://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html
2 Front operation

3 Common methods
3.1 getResponseCode
Method statement
public String getResponseCode()
function : Get response status code
zs = prev.getResponseCode();
log.info("status code is: " + zs);

result :
3.2 isResponseCodeOK
Method statement
public boolean isResponseCodeOK()
function : Determine whether the response status code is OK Corresponding status code (200)
zs = prev.isResponseCodeOK();
log.info("zs is: " + zs);

result :
3.3 getThreadName
Method statement
public String getThreadName()
function : Get the thread name
zs = prev.getThreadName();
log.info("zs is: " + zs);
result :
3.4 getAssertionResults
Method statement
public AssertionResult[] getAssertionResults()
function : Get the sampler assertion result
args = prev.getAssertionResults();
args.each{
log.info(it.getName() + ":" + it.getFailureMessage())
}
3.5 getContentType
Method statement
public String getContentType()
function : Get the sampler response Content-Type The value field of the first field ( Include parameters )
conten = prev.getContentType();
log.info("conten is:" + conten);
3.6 getMediaType
Method statement
public String getMediaType()
function : Get the sampler response Media-Type The value field of the first field ( No parameters )
mt = prev.getMediaType();
log.info("MT is:" + mt);
3.7 getSentBytes
Method statement
public long getSentBytes()
function : Get the size of sampler request message
senty = prev.getSentBytes();
log.info("senty is:" + senty);

3.8 getBytesAsLong
Method statement
public long getBytesAsLong()
function : Get the size of sampler response message
senty =prev.getBytesAsLong();
log.info("senty is:" + senty);

3.9 getLatency
Method statement
public long getLatency()
function : Get delay time
3.10 getConnectTime
Method statement
public long getConnectTime()
function : Get the connection time
3.11 getURL
Method statement
public URL getURL()
function : Get sampler request URL
url =prev.getURL();
log.info("url is:" + url);
3.12 getUrlAsString
Method statement
public String getUrlAsString()
function : Get sampler request URL character string
3.13 getGroupThreads
Method statement
public int getGroupThreads()
function : Gets the number of running threads under the thread group
thnum =prev.getGroupThreads();
log.info("thnum is:" + thnum);
result :
3.14 getHeadersSize
Method statement
public int getHeadersSize()
function : Get the size of the header field of the sampler response
headsize =prev.getHeadersSize();
log.info("headsize is:" + headsize);
result :
3.15 getBodySizeAsLong
Method statement
public long getBodySizeAsLong()
function : Get sampler response body size
bodysize =prev.getBodySizeAsLong();
log.info("bodysize is:" + bodysize);
result :
边栏推荐
- Fiddler抓包工具的使用
- Pointer learning diary (I)
- Teach you how to weld CAD design board bottom (for beginners) graphic tutorial
- Support complex T4 file systems such as model group monitoring and real-time alarm. e
- Emqx simple to use
- Blue Bridge Cup 31 day sprint 21 day (C language)
- Hcip-- review the homework for the next day
- Sword finger offer special assault edition day 7
- Using a* heuristic search to solve maze routing problem
- [Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket
猜你喜欢

Reading excerpts from Liu run's "bottom logic"

Kingbase V8R6集群安装部署案例---脚本在线一键缩容

Context encoders: feature learning by painting paper notes

Hcip-- review the homework for the next day

NLP learning roadmap (mind map) is very comprehensive and clear!

Kingbase V8R6集群安装部署案例---脚本在线一键扩容
![Embedded system transplantation [2] - Construction of cross development environment](/img/96/8d209c04e41675fc0efaa872c35615.png)
Embedded system transplantation [2] - Construction of cross development environment

postgresql:在Docker中运行PostgreSQL + pgAdmin 4

Kingbase v8r6 cluster installation and deployment case - script online one click capacity reduction

Bear market bottoming Guide
随机推荐
The network NN can calculate the NTCP provided by the host system
网NN计算能主机系统资e提供的NTCP
Support complex T4 file systems such as model group monitoring and real-time alarm. e
13. Write a program, in which a user-defined function is used to judge whether an integer is a prime number. The main function inputs a number and outputs whether it is a prime number.
Bear market bottoming Guide
DNS domain name resolution service
线程的介绍
【深度学习】(三)图像分类
Hotel IPTV digital TV system solution
[postgraduate entrance examination vocabulary training camp] day 10 - capital, expand, force, adapt, depand
2. Input a circle radius r, when r > = 0, calculate and output the area and perimeter of the circle, otherwise, output the prompt information.
智能指针、左值引用右值引用、lambda表达式
Learning pyramid context encoder network for high quality image painting paper notes
Un7.23: how to install MySQL on linix?
Illustration and text demonstrate the movable range of the applet movable view
Numpy statistical correlation function example tutorial
The world's first large aerospace model came out. Wenxin's second supplement "Fuchun Mountain Residence map" is Baidu Pratt Whitney AI's perseverance
SHP building contour data restoration, 3D urban white film data production
股票价格走势的行业关联性
Smart pointer, lvalue reference, lvalue reference, lambda expression