Giter Club home page Giter Club logo

benchmark-proxy's Introduction

English | 中文

Overview

a proxy tool for HTTP/HTTPS benchmark test

  • HTTP/HTTPS proxy
  • benchmark for api request
  • statistics spend time,success count and error count of requests
  • replace data(query's param or body) by tag in proxy request
  • check request api response data and status for diagnose success or fail

Requirement

To use HTTPS proxy, you must generate CA files.

  1. openssl genrsa -out ca.key 2048
  2. openssl req -new -x509 -key ca.key -out ca.crt -days 1095
  3. Update the system's trusted CA certificates

Run

benchmark-proxy --port {port} --ca-crt {file_path} --ca-key {file_path}

Request Example

curl -x 127.0.0.1:9900 http://www.baidu.com -H 'Benchmark-Proxy-Type:'times'' -H 'Benchmark-Proxy-Times:100' -H ' Benchmark-Proxy-Concurrency:100'

CustomHeaders

Header Meaning
Benchmark-Proxy-Times indicate how many times exec in each http request
Benchmark-Proxy-Duration indicate how much second exec in each http requests
Benchmark-Proxy-Concurrency concurrency in running
Benchmark-Proxy-Check-Result-Status indicate the response status to determine whether request is success
Benchmark-Proxy-Check-Result-Body indicate the response body to determine whether request is success

Response Checker

example :

  1. Benchmark-Proxy-Check-Result-Status: 200 Indicate http request is success that response status is 200
  2. Benchmark-Proxy-Check-Result-Body: hello world Indicate http request is success return that http response body is 'hello world'
  3. Benchmark-Proxy-Check-Result-Body: @Reg[\w] Indicate http request is success return that http response body is satisfied with provider regexp rule

ReplaceTag

Tag Example
${uuid} d035581b-53a3-48e5-9461-ba24709f06c9
${int} 6331615752200874333
${float} 0.681078
${string} 295dfd92fcd9cd9e43cfa5b2b87e806dda83eb3d7dfd97d5ef
${incr} 1(default:1,it will auto increment in every proxy request )

Architecture

alt 数据流图

benchmark-proxy's People

Contributors

zengzhuozhen 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.