如何使用jMeter测试SAP OData服务并发访问时的性能
For project reason I have to measure the performance of OData service being accessed parallelly. And I plan to use the open source tool JMeter to generate a huge number of request in parallel and measure the average response time. Since I am a beginner for JMeter, I write down what I have learned into this blog.
I will continue to explorer the advanced feature of JMeter in my daily work.
(1) Download JMeter from its official website. Go to the installation folder, add the following text in file binuser.properties:
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
(2) Create a new test plan for example Customer_Query_OData_test, and right click on it and create a thread group from context menu.
Below configuration means I would like to generate three request in parallel via three threads, each thread is executed only once. And there is no delay during the spawn of each threads ( Ramp-Up Period = 0 )
Create a new Http Request and maintain the following settings:
- Protocol: https
- Server name:
- Http request method: GET
- Http path: /sap/c4c/odata/v1/c4codata/AccountCollection/
- Use KeepAlive: do NOT select this checkbox In Parameter tab, maintain query option $search with value ‘Wang’
Switch to Advanced tab, choose “HttpClient4” from drop down list for Implementation, and maintain proxy server name and port number.
(3) Create a new HTTP Header Manager and specify the basic authentication header field and value.
(4) Create a listener for the test plan. In my test I simply choose the most simple one: View Results in Table.
Once done, start the test:
After the test is finished, double click on View Result Listener and the response time for each request and the average response time is displayed there:
Or you can use command line to achieve the same:
- -n: use non-GUI mode
- -t: specify which test plan you want to run
- -l: specify the path of output result file
And I have written a simple Java application to generate parallel request via multiple thread and the result measured in Java program is consistent with the one got from JMeter.
How to generate random query for each thread in JMeter
Suppose we would like each thread in JMeter to generate different customer query via OData with the format JerryTestCustomer_<1~100>, we can simply create a new user parameter:
- Parameter name: uuid
- Parameter value: use JMeter predefined function __Random to generate random number. So the value is: ${__Random(1,100)}
and in http request, just specify reference to this variable via ${uuid}:
So that in the end each thread will issue different query to OData service end point.
Further reading
You can find a list of all other blogs related to OData written by Jerry.
- Consume standard C4C OData service via ABAP code
- Leverage C4C Odata notification to monitor C4C Opportunity change in CRM system
- OData Service backend implementation in C4C, CRM and S4 HANA
- JMeter beginner – how to use JMeter to measure performance of OData service accessed parallelly
- Regarding cookie manipulation in CL_HTTP_CLIENT to avoid CSRF token validation failure issue
- [算法与数据结构] 《算法导论》堆排序笔记
- [数据结构与算法] 链表的其他类型
- [数据结构与算法] 链接表总结
- [数据结构与算法] 线性表总结
- [数据结构与算法] Python实现二分查找
- [机智的机器在学习] 机器学习中的归一化和正则化问题
- [情人节] jieba分词介绍
- 左手用R右手Python系列——异常捕获与容错处理
- 【观点】漫谈推荐系统及数据库技术(二)——分布式数据库技术
- BizTalk 2013R2 WCF-LOB Oracle Adapter安装配置/问题&解决方法
- 【Leetcode108】关关刷题日记65–Convert Sorted Array to Binary Search Tree
- 左手用R右手Python系列——动态网页抓取与selenium驱动浏览器
- 【Leetcode235】关关的刷题日记66 –Lowest Common Ancestor of a BST
- 初探Kotlin+SpringBoot联合编程
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法