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: jmeterPlugin.sts.port=9191 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作为编码: sampleresult.default.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 Started
There are different ways to start the STS:
jmeterPlugin.sts.loadAndRunOnStartup=true 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的示例: login1;password1 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,不得包含字符\ /:或.. http://hostname:port/sts/INITFILE?FILENAME=logins.csv HTML format:
Linked list after this command: login1;password1 READGet one line from list http://hostname:port/sts/READ?READ_MODE={FIRST, LAST, RANDOM}&KEEP={TRUE, FALSE}&FILENAME=logins.csv
HTML format:
Available options:
KEEP=TRUE, READ_MODE=FIRST => login1;password1 Linked list after this command: login2;password2 KEEP=TRUE, READ_MODE=LAST => login5;password5 Linked list after this command: login1;password1 KEEP=TRUE, READ_MODE=RANDOM => login2;password2 Linked list after this command: login1;password1 KEEP=FALSE (delete mode), READ_MODE=FIRST => login1;password1 Linked list after this command: login2;password2 KEEP=FALSE, READ_MODE=LAST => login5;password5 Linked list after this command: login1;password1 KEEP=FALSE, READ_MODE=RANDOM => login2;password2 Linked list after this command: login1;password1 ADDAdd a line into a file: (GET OR POST HTTP protocol) GET Protocol http://hostname:port/sts/ADD?FILENAME=dossier.csv&LINE=D0001123&ADD_MODE={FIRST, LAST}&UNIQUE={FALSE, TRUE}
GET Parameters : FILENAME=dossier.csv&LINE=D0001123&ADD_MODE={FIRST, LAST}&UNIQUE={FALSE, TRUE} POST Protocol http://hostname:port/sts/ADD 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 返回链表的剩余行数 http://hostname:port/sts/LENGTH?FILENAME=logins.csv HTML format:
STATUS显示已加载文件的列表以及每个链接列表的剩余行数 Display the list of loaded files and the number of remaining lines for each linked list http://hostname:port/sts/STATUS HTML format:
SAVESave the specified linked list in a file to the specified location 将文件中指定的链接列表保存到指定位置 http://hostname:port/sts/SAVE?FILENAME=logins.csv 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目录中: 20140520T16h33m27s.logins.csv HTML format:
RESETRemove all of the elements from the specified list http://hostname:port/sts/RESET?FILENAME=logins.csv HTML format:
STOPShutdown the Simple Table Server http://hostname:port/sts/STOP 有关详细信息,请参阅以下示例 在测试计划中使用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:
jmeter.bat -DjmeterPlugin.sts.loadAndRunOnStartup=true -DjmeterPlugin.sts.port=9191 -DjmeterPlugin.sts.datasetDirectory=d:/data -n –t testdemo.jmx 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的进程通信机制,取后一种意 ...
随机推荐
- Vue2.0+Webpack+Element+Axios+vueRouter技术栈使用过程总结
搭建项目架构 目采用Webpack+Vue-router的架构方式,开始安装(一切操作都在windows系统上完成) 1.按Win+R,然后在文本框中输入cmd,回车打开命令行,输入vue-cli安装 ...
- JavaScript组合模式---引入
首先:使用一个例子来引入组合模式,需求为(1)有一个学校有2个班(一班,二班)(2)每个班级分2个小组(一班一组,一班二组,二班一组,二班二组)(3)学校计算机教室有限,每一个小组分着来上课 然后:根 ...
- 怎样增加phpmyadmin导入文件上限
1 2 3 分步阅读 百度经验:jingyan.baidu.com phpMyAdmin 是一个用PHP编写的,可以通过 web 方式控制和操作 MySQL 数据库.因为操作简单被广大的使用mysql ...
- Winform状态栏控件中Label靠右显示的方法
设计器: 代码: 在Form_Load事件中添加 : statusStripMain.LayoutStyle= ToolStripLayoutStyle.HorizontalStackWithOv ...
- 【总结整理】javascript基础入门学习(慕课网学习)
https://www.imooc.com/learn/36 注意: javascript作为一种脚本语言可以放在html页面中任何位置,但是浏览器解释html时是按先后顺序的,所以前面的script ...
- Guava Cache本地缓存
Guava介绍 Guava是一种基于开源的Java库,其中包含谷歌正在由他们很多项目使用的很多核心库. 这个库是为了方便编码,并减少编码错误. 这个库提供用于集合,缓存,支持原语,并发性,常见注解,字 ...
- win10 requireAdministrator设置开机自启动无效的解决方案
开发了一个wpf程序,需要管理员权限,设置了requireAdministrator 同时需要开机自启动,所以添加了注册表: using (RegistryKey key = Registry.Cur ...
- 图(最短路径算法————迪杰斯特拉算法和弗洛伊德算法).RP
文转:http://blog.csdn.net/zxq2574043697/article/details/9451887 一: 最短路径算法 1. 迪杰斯特拉算法 2. 弗洛伊德算法 二: 1. 迪 ...
- 用C#截取指定长度的中英文混合字符串
很早以前写过一篇文章(用C#截取指定长度的中英文混合字符串),但是对性能没有测试,有人说我写的这个方法性能有问题,后来想,可能真会有BT之需求要求传入一个几万K甚至几M体积的字符串进来,那将会影响正则 ...
- [译]在Javascript中进行日期相关的操作
本文翻译youtube上的up主kudvenkat的javascript tutorial播放单 源地址在此: https://www.youtube.com/watch?v=PMsVM7rjupU& ...





