51Testing软件测试论坛

标题: 区块链性能测试工具的使用攻略 [打印本页]

作者: lsekfe    时间: 2022-12-23 13:35
标题: 区块链性能测试工具的使用攻略
HyperBench为区块链提供了一套通用的性能测试方案,能够适配多种不同的区块链平台,基于脚本和虚拟机可以灵活快速地构建区块链性能测试用例,秉承高效、灵活、可扩展的设计理念,为区块链性能测试标准化、易用化助力,促进区块链技术发展,更好地为区块链业务赋能。
  【技术特性】
  灵活:提供基于Lua脚本和虚拟机提供的用户钩子的可编程用例扩展;
  高效:虚拟机内置有统一接口的Go区块链客户端,直接对区块链系统进行测试,不需要额外的应用服务;
  分布式:支持分布式测试功能,支持使用多台压力机同时测试区块链系统,简单易用。
  快速开始
  从源代码构建Hyperbench
  # clone Hyperbench repository into the $GOPATH/src/github.com/hyperbench/hyperbench directory:
  mkdir $GOPATH/src/github.com/hyperbench && cd $GOPATH/src/github.com/hyperbench
  git clone git@github.com:hyperbench/hyperbench.git
  cd hyperbench
  # build main program
  make build
  # copy build hyperbench program to $GOPATH/bin
  cp hyperbench $GOPATH/bin


  从源代码构建插件
  # clone Hyperbench-plugins into the $GOPATH/src/github.com/hyperbench/hyperbench-plugins directory:
  cd $GOPATH/src/github.com/hyperbench
  git clone git@github.com:hyperbench/hyperbench-plugins.git
  # build hyperchain for example
  cd hyperbench-plugins/hyperchain
  make build
  cp hyperchain.so ../../hyperbench/hyperchain.so


  在Hyperchain上运行HyperBench
  在开始压力测试之前,需要在准备超连接网络之前安装docker和docker-compose。
  ▲开启Hyperchain网络
  # start hyperchain network
  cd $GOPATH/src/github.com/hyperbench/hyperbench/benchmark/hyperchain
  bash control.sh start


  ▲开启压力测试
  # use benchmark/hyperchain/local as test case, star benchmark test
  cd $GOPATH/src/github.com/hyperbench/hyperbench
  hyperbench start benchmark/hyperchain/local


  在Fabric上运行HyperBench
  在开始压力测试之前,需要在准备fabric网络之前安装docker和docker-compose。
  ▲开启Fabric网络
  # start fabric network
  cd $GOPATH/src/github.com/hyperbench/hyperbench/benchmark/fabric/example/fabric
  bash deamon.sh
  # if it's the first time for you to pull the docker images, please be patient
  # and if a timeout bug occurs, please try again


  ▲开启压力测试
  # use benchmark/fabric/example as test case, star benchmark test
  cd $GOPATH/src/github.com/hyperbench/hyperbench
  hyperbench start benchmark/fabric/example


  ▲License
  Hyperbench目前使用Apache 2.0许可证。






欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2