Jmeter常用组件介绍

      做完了第一个Jmeter之后,我们发现Jmeter可以很容易的通过一些操作来实现测试,当然Jmeter同时也支持脚本和录制方式的测试,这以后再说,现在我们就来了解下这些组件的用处及使用方式

   1 线程组

      每个测试都会用到的,如前所说,这个是用来设置并发访问线程数量的

  2 监听器

    监听器组件是用来监听测试结果的,它里面包括许多种不同的监听方式

    1) 保存响应到文件

     image

这个监听器的作用是将结果保存到指定的文件中

  文件名前缀:如 E:/tmp/test_,可以指定具体路径,生成的结果加上一年累加的数字,后缀名则会根据返回的结果来决定,比做http请求,返回的是一个http页面,则文件名后缀为html

variable Number:暂时不清楚什么用的

这样,结果就会保存到指定的文件了,这种方式一般适合结果数据量很大或是带有函数返回结果的情况

  2) 生成概要结果

   image

   生成概要结果,不会有明细数据,只有一个最终的概要结果,如平均响应时间,最多响应时间等,它也不输出在界面上,而是输出到控制台上

结果如下:

image 

 

  3) 断言结果

     断言结果要断言一同使用才有效果,将其放到与断言一起讲

  4) bsf linstenter

     这个要同BSF samper一同使用,将其放到同BSF Samper一起讲

  5) BeanShell Listenter

     这个需要同BeanShell一起使用,将其放到BeanShell一起讲

  6) Distribution Graphs(alpha)

     image

      结果的一个图形化的显示,里面有两个重要的参数,50%和90%,意思是50%的请求的响应时间在什么范围内,90%请求的响应时间在什么范围内,如上图,50%的请求在3ms内可以完成响应,而90%的请求在93ms内完成响应

 

7)图形结果

    image

图形结果以图形的方式提供直观的结果,它可以提供包括数据,平均值,中值,偏离及吞量等数据

 

Simple Data Writer

This listener can record results to a file but not to the UI. It is meant to provide an efficient means of recording data by eliminating GUI overhead. When running in non-GUI mode, the -l flag can be used to create a data file. The fields to save are defined by JMeter properties. See the jmeter.properties file for details.

image

 

Spline Visualizer

  image

一个图形化的显示方式,效果看上图就知道了

Aggregate Graph

The aggregate graph is similar to the aggregate report. The primary difference is the aggregate graph provides an easy way to generate bar graphs and save the graph as a PNG file. By default, the aggregate graph will generate a bar chart 450 x 250 pixels.

 

2 Sampler

  Sampler决定着Jmeter的工具

FTP Request

This controller lets you send an FTP "retrieve file" or "upload file" request to an FTP server. If you are going to send multiple requests to the same FTP server, consider using a FTP Request Defaults Configuration Element so you do not have to enter the same information for each FTP Request Generative Controller. When downloading a file, it can be stored on disk (Local File) or in the Response Data, or both.

Latency is set to the time it takes to login (versions of JMeter after 2.3.1).

Control Panel

Parameters

Name
Descriptive name for this controller that is shown in the tree.
No

Server Name or IP
Domain name or IP address of the FTP server.
Yes

Port
Port to use. If this is >0, then this specific port is used, otherwise JMeter uses the default FTP port.
No

Remote File:
File to retrieve or name of destination file to upload.
Yes

Local File:
File to upload, or destination for downloads (defaults to remote file name).
Yes, if uploading (*)

Local File Contents:
Provides the contents for the upload, overrides the Local File property.
Yes, if uploading (*)

get(RETR) / put(STOR)
Whether to retrieve or upload a file.
Yes

Use Binary mode ?
Check this to use Binary mode (default Ascii)
Yes

Save File in Response ?
Whether to store contents of retrieved file in response data. If the mode is Ascii, then the contents will be visible in the Tree View Listener.
Yes, if downloading

Username
FTP account username.
Usually

Password
FTP account password. N.B. This will be visible in the test plan.
Usually

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值