csv HTTP简单表服务器
HTTP Simple Table ServerPerformance testing with JMeter can be done with several JMeter injectors (on a remote host) and one JMeter controller (with GUI, on your local host). Scripts are sent to JMeter injectors using RMI protocol. Results are brought back periodically to the JMeter controller. Unfortunately the dataset and csv files aren't transferred from the controller to injectors. The main idea is to use a tiny http server in JMeter Plugins to manage the dataset files with simple commands to get / add rows of data in files. 使用JMeter进行性能测试可以使用多个JMeter注入器(在远程主机上)和一个JMeter控制器(在本地主机上使用GUI)完成。使用RMI协议将脚本发送到JMeter注入器。结果定期返回JMeter控制器。遗憾的是,数据集和csv文件不会从控制器传输到喷射器。 主要思想是在JMeter插件中使用一个微小的http服务器来管理数据集文件,使用简单的命令来获取/添加文件中的数据行。 组态在jmeter.properties文件中: ConfigurationIn jmeter.properties file:
Do not use '\' in the path directory, it doesn't work well, use '/' or '\' instead. It is also recommended to use UTF-8 as the encoding: 不要在路径目录中使用'\',它不能很好地工作,而是使用'/'或'\'。还建议使用UTF-8作为编码:
If you want automatically start a Simple Table Server on JMeter STARTUP simply add "simple-table-server.bsh" in the "beanshell.init.file" property. Be sure that simple-table-server.bsh file is in your JMETER_HOME/bin directory. The Simple Table Server is a tiny http server which can send http GET/POST requests on port 9191 (by default). You can set a custom port through the graphical user interface or by overriding the jmeterplugin.sts.port property. 如果要在JMeter STARTUP上自动启动简单表服务器,只需在“beanshell.init.file”属性中添加“simple-table-server.bsh”即可。确保simple-table-server.bsh文件位于JMETER_HOME / bin目录中。 Simple Table Server是一个很小的http服务器,它可以在端口9191上发送http GET / POST请求(默认情况下)。您可以通过图形用户界面或通过覆盖jmeterplugin.sts.port属性来设置自定义端口。 JMeter的分布式架构简单表服务器在JMeter控制器(主服务器)上运行,负载生成器(从服务器)调用STS来获取或添加一些数据。在测试开始时,第一个负载生成器将在内存中加载数据(初始调用),并在测试结束时询问STS在文件中保存值。所有负载生成器都会询问来自JMeter控制器上启动的同一STS的数据。 Distributed architecture for JMeterThe Simple Table Server runs on the JMeter controller (master) and load generators (slaves) make calls to the STS to get or add some data. At the beginning of the test, the first load generator will load data in memory (initial call) and at the end of the test it asks the STS saving values in a file. All the load generators ask data from the same STS which is started on the JMeter controller. Getting StartedThere are different ways to start the STS:
When the STS is running go to http://<HOST>:<PORT>/sts/ to see all available commands. Calls are synchronized, all commands are executed one by one. Example of a dataset file logins.csv: 当STS运行时,转到http:// <HOST>:<PORT> / sts /以查看所有可用命令。 呼叫是同步的,所有命令都是逐个执行的。 数据集文件logins.csv的示例:
INITFILELoad file in memory. Lines are stored in a linked list, 1 line = 1 element The filename is limited to 128 characters maxi and must not contains characters \ / : or .. 在内存中加载文件。行存储在链表中,1行= 1个元素 文件名限制为128个字符maxi,不得包含字符\ /:或..
HTML format:
Linked list after this command:
READGet one line from list
HTML format:
Available options:
KEEP=TRUE, READ_MODE=FIRST => login1;password1 Linked list after this command:
KEEP=TRUE, READ_MODE=LAST => login5;password5 Linked list after this command:
KEEP=TRUE, READ_MODE=RANDOM => login2;password2 Linked list after this command:
KEEP=FALSE (delete mode), READ_MODE=FIRST => login1;password1 Linked list after this command:
KEEP=FALSE, READ_MODE=LAST => login5;password5 Linked list after this command:
KEEP=FALSE, READ_MODE=RANDOM => login2;password2 Linked list after this command:
ADDAdd a line into a file: (GET OR POST HTTP protocol) GET Protocol
GET Parameters : FILENAME=dossier.csv&LINE=D0001123&ADD_MODE={FIRST, LAST}&UNIQUE={FALSE, TRUE}
POST Parameters : FILENAME=dossier.csv, LINE=D0001123, ADD_MODE={FIRST, LAST}, UNIQUE={FALSE, TRUE} HTML format:
Available options:
POST Protocol with parameters LENGTHReturn the number of remaining lines of a linked list 返回链表的剩余行数
HTML format:
STATUS显示已加载文件的列表以及每个链接列表的剩余行数 Display the list of loaded files and the number of remaining lines for each linked list
HTML format:
SAVESave the specified linked list in a file to the specified location 将文件中指定的链接列表保存到指定位置
If jmeterPlugin.sts.addTimestamp is set to true then a timestamp will be add to the filename, the file is stored in the custom directory specified by editing the jmeterPlugin.sts.datasetDirectory property or in JMETER_HOME/bin directory by default: 如果jmeterPlugin.sts.addTimestamp设置为true,则会将时间戳添加到文件名,该文件存储在通过编辑jmeterPlugin.sts.datasetDirectory属性指定的自定义目录中,或默认情况下存储在JMETER_HOME / bin目录中:
HTML format:
RESETRemove all of the elements from the specified list
HTML format:
STOPShutdown the Simple Table Server
有关详细信息,请参阅以下示例 在测试计划中使用STS通过使用一个或多个HTTP请求采样器调用URL,使用“setUp线程组”初始化文件。 读取一行数据是通过HTTP请求采样器在每次迭代时调用READ方法完成的。然后,您可以使用正则表达式提取器来解析响应数据。 阅读登录 See examples below for further information. Using STS in a Test PlanInitialize file using a "setUp Thread Group" by calling URL with one or more HTTP Request Sampler. Reading a row of data is done by calling READ method at each iteration by a HTTP Request Sampler. Then you can use a Regular Expression Extractor to parse the response data. Reading login: Reading password: At the end of your Test Plan you can save remaining/adding data with a HTTP Request Sampler in a "tearDown Thread Group". Example
In a loop, read random values from a file containing a login and a password at each row: Read value from a file containing a login and a password at each row, each value is unique and cannot be read anymore: Add rows in a new linked list and save it in a file when the test is done: Read in a random mode a dataset located on the controller machine with severals slaves. The first injector loads the dataset in memory while the other injectors are waiting few seconds. The different injectors read randomly the data containing logins and passwords. When the test is done the first injector save the values in a file with a timestamp as prefix: You can override STS settings using command-line options:
When it's done see results in the Listener Tree View. |
在测试计划结束时,您可以使用“泪滴线程组”中的HTTP请求采样器保存剩余/添加数据。
例
- 将logins.csv文件放在JMETER_HOME / bin目录中:
- 使用simple-table-server.cmd文件手动运行Simple Table Server,或使用beanShell配置自动运行。
- 运行以下脚本之一:
在循环中,从包含每行的登录名和密码的文件中读取随机值:
从包含每行的登录名和密码的文件中读取值,每个值都是唯一的,不能再读取:
在新链接列表中添加行并在测试完成后将其保存在文件中:
以随机模式读取位于控制器机器上的具有多个从站的数据集。第一个喷射器将数据集加载到内存中,而其他喷射器等待几秒钟。不同的注射器随机读取包含登录名和密码的数据。测试完成后,第一个注入器将值保存在一个文件中,时间戳为前缀:
您可以使用命令行选项覆盖STS设置:
- -DjmeterPlugin.sts.port = <端口号>
- -DjmeterPlugin.sts.loadAndRunOnStartup = <真/假>
- -DjmeterPlugin.sts.datasetDirectory = <路径/到/你的/目录>
- -DjmeterPlugin.sts.addTimestamp = <真/假>
csv HTTP简单表服务器的更多相关文章
- Socket网络编程--简单Web服务器(1)
这一次的Socket系列准备讲Web服务器.就是编写一个简单的Web服务器,具体怎么做呢?我也不是很清楚流程,所以我找来了一个开源的小的Web服务器--tinyhttpd.这个服务器才500多行的代码 ...
- python socket 实现的简单http服务器
预备知识: 关于http 协议的基础请参考这里. 关于socket 基础函数请参考这里. 关于python 网络编程基础请参考这里. 一.python socket 实现的简单http服务器 废话 ...
- PHP -- 简单表单提交
网上看博文,一步步入门~~ 简单表单,简单提交 @_@!! <?php //php代码部分开始 echo "<html>"; echo "<hea ...
- Pandas对于CSV的简单操作
Pandas对于CSV的简单操作 最近在研究pandas对于csv文件的读取以及一些操作,网上的信息比较乱,写篇博客记录一下,毕竟自己写的才是最适合自己的用法. 首先我们应该都知道,pandas是一个 ...
- C#中使用Socket实现简单Web服务器
上一篇博客中介绍了怎样使用socket访问web服务器.关键有两个: 熟悉Socket编程: 熟悉HTTP协议. 上一篇主要是通过socket来模拟浏览器向(任何)Web服务器发送(HTTP)请求,重 ...
- 用nodejs搭建一个简单的服务器
使用nodejs搭建一个简单的服务器 nodejs优点:性能高(读写文件) 数据操作能力强 官网:www.nodejs.org 验证是否安装成功:cmd命令行中输入node -v 如果显示版本号表示安 ...
- 初学Node(六)搭建一个简单的服务器
搭建一个简单的服务器 通过下面的代码可以搭建一个简单的服务器: var http = require("http"); http.createServer(function(req ...
- 搭建无限制权限的简单git服务器使用git-daemon脚本
如果想要用ubantu架设无限制权限(即不适用gitosis)的简单git服务器,实现git库下载clone,push等简单的基本功能, 可以直接使用git-daemon脚本(非常不安全,建议项目代码 ...
- 运用socket实现简单的服务器客户端交互
Socket解释: 网络上的两个程序通过一个双向的通信连接实现数据的交换,这个连接的一端称为一个socket. Socket的英文原义是“孔”或“插座”.作为BSD UNIX的进程通信机制,取后一种意 ...
随机推荐
- Eclipse: “The import java.io cannot be resolved”
检查一下选项: 重点看jdk的绑定 43down voteaccepted Check your Eclipse preferences: Java -> Installed JREs. The ...
- struts2学习笔记(1)配置与基本操作
主要作用:将请求与页面区分开 配 置: 下载struts 2.0,在安装路径D:\项目学习\三大框架视屏\struts-2.3.24-all\struts-2.3.24\apps 中解压struts2 ...
- request 10.0 模块安装
https://pypi.python.org/packages/49/6f/183063f01aae1e025cf0130772b55848750a2f3a89bfa11b385b35d7329d ...
- Ros问题汇总
1.ImportError: No module named beginner_tutorials.srv 解决: cd ~/catkin_ws $ source devel/setup.bash $ ...
- Ros学习调试——rqt_console
1.rqt_console rqt_console:ROS日志框架(logging framework)的一部分,用来显示节点的输出信息 rqt_logger_level:允许我们修改节点运行时输出信 ...
- vue 跨域访问http
axios用法: npm install axios --save-dev 2.导入: import axios from 'axios'; 3.使用($(form)需要先按装jQuery) axio ...
- 生产者与消费者-N:N-基于list
多个生产者/多个消费者: /** * 生产者 */ public class P { private MyStack stack; public P(MyStack stack) { this.sta ...
- cximage使用
为什么使用CxImage u 使用简单:下面的入门教程会给你展示这一点. 构造函数 初始化 多帧图像操作 区域选择操作 Alpha通道操作 Layers 图像层操作 Attributes 图像属性操作 ...
- PHP中 Include 与 Require之间的区别
*引入机制 如果没有给出目录(只有文件名)时则按照 include_path 指定的目录寻找.如果在 include_path 下没找到该文件则 include 最后才在调用脚本文件所在的目录和当前工 ...
- TimerTask
当TimerTask实例通过schedule方法使用之后,不能通过schedule方法调用第二次,如果重复使用就会抛异常TimerTask is scheduled already. 当你重新想利用这 ...