Giter Club home page Giter Club logo

broly's Introduction

Broly

license GitHub release (latest by date) GitHub Sponsors

This is a high performance stub server.

Usage

broly target.json -p 9999

stub settings (JSON Format) is below.
see a sample here.

Field Type Required Default Sample
- (parent) JSONArray or JSONObject True - -
path string True - "/hello"
method string True - "GET"
contentType string False application/json "application/json"
statusCode string True - "200"
response string True - "{"name": "hello"}"
sleep number False 0 1000 (milliseconds)

Option is below.

Option Description
-p,--port specify the port you want to serve

Install

1. Mac

# Install
brew install solaoi/tap/broly
# Update
brew upgrade broly

2. BinaryRelease

# Install with wget or curl
## set the latest version on releases.
VERSION=v1.0.0
## set the OS you use. (linux or macos)
OS=linux
## case you use wget
wget https://github.com/solaoi/broly/releases/download/$VERSION/broly_${OS}.tar.gz
## case you use curl
curl -LO https://github.com/solaoi/broly/releases/download/$VERSION/broly_${OS}.tar.gz
## extract
tar xvf ./broly_${OS}.tar.gz
## move it to a location in your $PATH, such as /usr/local/bin.
mv ./broly /usr/local/bin/

3. Docker

RunOnly

# Specify the port you want to provide
HOST_PORT=80
# Specify the filename you want to serve
STUB_JSON=filename.json

# Run Container
docker run --init \
-p $HOST_PORT:8080 \
--mount type=bind,src=`pwd`/$STUB_JSON,dst=/target.json \
ghcr.io/solaoi/broly:latest

Local Build & Run

# Download this repo
git clone https://github.com/solaoi/broly.git
cd broly

# Specify the port you want to provide
HOST_PORT=80

# Edit stubs for serving
vi target.json

# Build DockerImage
docker build -t broly .

# Run Container
docker run --init \
-p $HOST_PORT:8080 \
-t broly

4. Nimble

# Install & Update
nimble install broly

Benchmark

  • Tool: Vegeta
  • Command:
    echo 'GET http://localhost:9999/hello' | vegeta attack -duration=60s | vegeta report
  • Environment: on DockerContainer

Broly

Requests      [total, rate, throughput]         3000, 50.02, 50.01
Duration      [total, attack, wait]             59.985s, 59.982s, 3.197ms
Latencies     [min, mean, 50, 90, 95, 99, max]  958.602µs, 2.906ms, 2.989ms, 3.334ms, 3.439ms, 3.682ms, 8.954ms
Bytes In      [total, mean]                     51000, 17.00
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           100.00%
Status Codes  [code:count]                      200:3000  
Error Set:

demo is here.

Requests      [total, rate, throughput]         3000, 50.02, 50.02
Duration      [total, attack, wait]             59.98s, 59.976s, 3.466ms
Latencies     [min, mean, 50, 90, 95, 99, max]  1.036ms, 6.185ms, 3.421ms, 4.056ms, 4.36ms, 34.511ms, 567.831ms
Bytes In      [total, mean]                     48000, 16.00
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           100.00%
Status Codes  [code:count]                      200:3000  
Error Set:

Affinity

Broly's JSON Format is compatible with co-metub.

co-metub is a GUI tool to manage stubs and export stubs in JSON Format.

If you manage stubs with GUI, you should use co-metub.

But if you switch some stubs or attack strongly a stub server, you should use Broly.

broly's People

Contributors

solaoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

broly's Issues

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.