很多时候我们使用jmeter测试http,其实通过jmeter插件,我们也可以实现模拟udp测试,例如dns服务器的性能测试。
测试方法:
1.访问 http://jmeter.apache.org/download_jmeter.cgi 下载jmeter(需至少2.8以上版本,本文测试使用2.11版本), 可以下载binary包,放到linux或者windows上直接用
2. 去 http://jmeter-plugins.org/downloads/all/ 下载以下插件:
JMeterPlugins-ExtrasLibs-1.1.3.zip,
JMeterPlugins-Extras-1.1.3.zip,
JMeterPlugins-Standard-1.1.3.zip
3. 将上述三个压缩包中的 lib文件夹 覆盖 jmeter目录下的lib文件夹
============准备完毕===========
测试步骤
1. 打开jmeter, 添加一个Thread group,然后再该thread group下添加一个Sampler- jp@gc-udp request
2. 在当前所在的test plan下,增加如下图图形化listener
3. UDP reqeust sampler 按如下方式设置,替换域名,ip为你的服务器
Full Class Name | Comments | |
kg.apc.jmeter.samplers.HexStringUDPDecoder | This is most useful implementation, converts data from/to HEX-encoded sequences. For example, 6a6d6574657220706c7567696e73 corresponds to jmeter plugins. | |
kg.apc.jmeter.samplers.DNSJavaDecoder | This implementation requires Extras With Libs Set to be installed. Request data must contain three fields, separated with spaces: name, type, class. Example: www.com. A IN. Response data converted to text using DNSJava. Request flags can be set using +/- integer value on new line, eg 7 sets reqursion desired flag. | |
kg.apc.jmeter.samplers.UDPSampler | This implementation used as default when no valid class name specified in GUI. It makes no conversion on data. |
4.随便发起一定数量的测试后,点击 Composite Graph,进入Grpahs设置界面,选择希望合并的报表,将其选择到右侧:
5. 发起正式测试,系统将产生合并的报表
详细测试用例文章:http://jmeter-plugins.org/wiki/dns_test_using_jmeter/