ZooKeeper性能测试

本文介绍如何使用开源工具对ZooKeeper进行性能测试,包括打包jar文件、配置maven插件、创建Docker镜像,并提供了执行命令的详细步骤。

参考来源如下。

https://github.com/brownsys/zookeeper-benchmark

打包

使用开源工具进行 ZooKeeper 的性能测试,参考官方文档,通过 mvn -DZooKeeperVersion=<version> package 进行打包。但是为了使用方便,我把所有的依赖包都打成一个大的 jar 包了,所以在 pom.xml 文件加上下面的插件,然后再执行命令 mvn assembly:assembly 即可。

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <version>2.3.1</version>
      <configuration>
Version: Applicable to JMeter 2.8+(适用JMeter版本) 以下为官方说明: Prepare a simple IdGenerator For security reasons, ZK generates ID randomly. However to perform a record & reply test, it is mandatory to fix the IDs of the components. The IdGenerator here is used to create a predictable component id when testing. ———— 官方描述地址 http://blog.zkoss.org/index.php/2013/08/06/zk-jmeter-plugin/ 编译后的class文件,是需要配合jar包一起用的,用来自动关联uuid和data,jar包里面只解决了dtid。因为官方提供源码,需要自己编译后才可以用,我这里是已经编译好的class。(提供给那些没有条件编译的朋友) ———— 使用方法: 1.解压后classes\foo\jmtest目录 直接覆盖在 被测的ZK平台对应目录中(WEB-INF下)。 2.修改zk.xml文件,添加下面内容(WEB-INF下) foo.jmtest.SimpleIdGenerator 3.安装ZK的JMeter插件 把压缩包中的 zk-jmeter-plugin-0.8.0.jar 文件,复制到 JMETER_HOME\lib\ext. ———— 安装完整,重新打开JMeter,可以添加ZK http 代理,录制脚本试试。 下面录制步骤: Prepare a Test Plan 1.Create a Thread Group in Test Group. 2.Add HTTP Cookie Manager in Thread Group 3.Add HTTP Request Defaults in Thread Group. 4.Add Transaction Controller in Thread Group. 5.Edit HTTP Request Defaults, set the Server Name and Port Number. 6.Create a ZK HTTP Proxy Server (Add > Non-Test Elements) in WorkBench, and edit it as follows Set Target Controller to Test Plan > Thread Group > Transaction Controller 7.Start the ZK HTTP Proxy Server
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值