Code Monkey home page Code Monkey logo

benchmark-tool's Introduction

Usage: 
benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-r] [-k] [-u]
 -h <host> Server ip (default 127.0.0.1)
 -p <port> Server port (default 5113)
 -c <clients> Number of parallel connections (default 5)
 -n <requests> Total number of requests (default 50)
 -k keep alive or reconnect (default is reconnect)
 -r re-encode sendbuf per request (default is no encode)
 -u benchmark with udp protocol(default is tcp)

for example:
dc@ubuntu:~/benchmark$ ./benchmark -c 50 -n 1000 -p 80  -k
keepAlive is open
50 parallel clients
1000 completed in 0 seconds
78.6% <= 1 milliseconds
100% <= 1 milliseconds
1000 requests are neend
1035 requests are sended
0 clients are timeout
999 clients are reset
50 clients are created
21 total milliseconds used
47619 requests per second

How to make a test use case?
1.mkdir module
2.create a cpp file that include "module.h" , overload the encodeRequest and decodeResponse function.
/*
* encode success return the data len
* encode fail return -1
*/
int encodeRequest(char* data, int maxLen);

/*
* decode success return 0
* decode fail return -1
* not a complete package(tcp is stream), need wait more data return 1
*/
int decodeResponse(char* data, int len);

benchmark-tool's People

Contributors

dcshi avatar

Watchers

 avatar  avatar  avatar

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.