Giter Club home page Giter Club logo

lever's Introduction

Stress testing for java-tron's gRPC

lever

lever is a stress testing tool for java-tron.

How to use?

Run a private blockchain of java-tron

Read the Start Private Blockchain. Two accounts need to be reserved, one for initiating the transfer and one for receiving the transfer amount.

Jmeter

  1. Install Jmeter.

lever

  1. Generate jar and run test:
$ git clone https://github.com/tronprotocol/lever.git
$ cd lever
$ ./gradlew build
$ ./gradlew clean shadowJar -PmainClass=org.tron.program.RpcHunterSendCoin
$ cp build/libs/org.tron.program.RpcHunterSendCoin.jar jmeter/lib/ext/org.tron.program.RpcHunterSendCoin.jar
$ cp src/main/resources/jmeter-setting.jmx jmeter/bin/
$ cd jmeter/bin
$ ./jmeter -n -t /jmeter-setting.jmx -l test_result.jtl -e -o /resultReport
  1. Configuration

2.1 config.conf

lever/src/main/resources/config.conf

grpc.address = "127.0.0.1:50051" # target gRPC server address

2.2 jmeter-setting.jmx

lever/src/main/resources/jmeter-setting.jmx

10 threads running for 1800 seconds:

  <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
    <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
    <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
      <boolProp name="LoopController.continue_forever">false</boolProp>
      <intProp name="LoopController.loops">-1</intProp>
    </elementProp>
    <stringProp name="ThreadGroup.num_threads">10</stringProp>
    <stringProp name="ThreadGroup.ramp_time">1</stringProp>
    <boolProp name="ThreadGroup.scheduler">true</boolProp>
    <stringProp name="ThreadGroup.duration">1800</stringProp>
    <stringProp name="ThreadGroup.delay"></stringProp>
  </ThreadGroup>

Transaction arguments(put your arguments: Argument.value to this file):

<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Java Request" enabled="true">
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
    <collectionProp name="Arguments.arguments">
      <elementProp name="toAddress" elementType="Argument">
        <stringProp name="Argument.name">toAddress</stringProp>
        <stringProp name="Argument.value">27d3byPxZXKQWfXX7sJvemJJuv5M65F3vjS</stringProp>
        <stringProp name="Argument.metadata">=</stringProp>
      </elementProp>
      <elementProp name="amount" elementType="Argument">
        <stringProp name="Argument.name">amount</stringProp>
        <stringProp name="Argument.value">1</stringProp>
        <stringProp name="Argument.metadata">=</stringProp>
      </elementProp>
      <elementProp name="privateKey" elementType="Argument">
        <stringProp name="Argument.name">privateKey</stringProp>
        <stringProp name="Argument.value">effa55b420a2fe39e3f73d14b8c46824fd0d5ee210840b9c27b2e2f42a09f1f9</stringProp>
        <stringProp name="Argument.metadata">=</stringProp>
      </elementProp>
    </collectionProp>
  </elementProp>
  <stringProp name="classname">org.tron.program.RpcHunterSendCoin</stringProp>
</JavaSampler>

Throughout setting(60/s):

<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true">
  <doubleProp>
    <name>throughput</name>
    <value>60.0</value>
    <savedValue>0.0</savedValue>
  </doubleProp>
  <intProp name="calcMode">1</intProp>
</ConstantThroughputTimer>

You can use generate-account-tool to generate your account and put it to java-tron's config.conf: genesis.block.assets, genesis.block.witnesses, localwitness

lever's People

Contributors

ahnsinyong avatar codeninjaevan avatar guoygang avatar huzhenyuan avatar iiimoon avatar ithinker1991 avatar kookiekrak avatar lvs007 avatar mu1one avatar nanfengpo avatar olenheim avatar qingjiechern avatar renchenchang avatar sasaxie avatar sdargutev avatar sean-liu55 avatar taihaofu avatar tjchern avatar wubin12 avatar xiechang33 avatar xxo1shine avatar ybhgenius avatar yixiaoqun1990 avatar yrp avatar zergweak avatar zhaohong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lever's Issues

shadowJar has no value specified for property 'mainClassName'

Hi there,
I have a clean install of java-tron from the develop branch today. I tried to follow your instructions exactly, but received the following errors (after a successful ./gradlew build):

rafeeki@rafeeki:~/GitHub/java-tron$ ./gradlew clean shadowJar -PmainClass=org.tron.program.RpcHunterSendCoin

> Task :generateProto UP-TO-DATE
Using TaskInputs.file() with something that doesn't resolve to a File object has been deprecated and is scheduled to be removed in Gradle 5.0. Use TaskInputs.files() instead.

> Task :compileJava 
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :shadowJar 
A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
 - No value has been specified for property 'mainClassName'.


BUILD SUCCESSFUL in 13s
7 actionable tasks: 6 executed, 1 up-to-date
rafeeki@rafeeki:~/GitHub/java-tron$ cp build/libs/org.tron.program.RpcHunterSendCoin jmeter/lib/ext/org.tron.program.RpcHunterSendCoin
cp: cannot stat 'build/libs/org.tron.program.RpcHunterSendCoin': No such file or directory

Please advise, I would really like to stress test the Tron testnet.

README Suggestion

I found some of the commands in the README need to be cleaned up. The first instance is the cp command needs the .jar extension or it can't find the file:

cp build/libs/org.tron.program.RpcHunterSendCoin.jar jmeter/lib/ext/org.tron.program.RpcHunterSendCoin

The second instance is when you run jmeter the console gives instructions for running load tests

Don't use GUI mode for load testing !, only for Test creation and Test debugging.
For load testing, use NON GUI Mode:
jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]

From this I get the following

touch recording.xml && mkdir webreports
./jmeter/bin/jmeter -n -t src/main/resources/jmeter-setting.jmx -l recording.xml -e -o webreports

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.