Code Monkey home page Code Monkey logo

ab-runner's Introduction

AB runner

An opinionated Apache Benchmark (ab) runner and result plotter.

Comparison boxplot example

Purpose

Running ab once can give unreliable results. Maybe your server is doing other work or your machine running the test is busy. To circumvent that issue, this script can take multiple measurements with a wait time in between.

Contents

Installation

Requirements:

To install:

  • Clone this repository.
  • Run npm install

Quick start

./abrunner.js measure --help
./abrunner.js compare --help

Measure

A typical run can be started like this:

./abrunner.js measure -u https://localhost.test/ -o results/foo

This used the default settings. It will run 10 measurements of 500 requests with 10 concurrency. Between each measurement it will wait for 5 minutes. The results will be stored in ./results/foo.

For more advanced options, read the advanced measure docs.

Results

Running this command will create a bunch of outputs:

  • iteration*.dat files contain the ab raw measurements
  • iteration*.out files contain the ab output (that is normally outputted in the terminal)
  • combined.dat contains all combined measurements
  • combined.stats contain some statistics collected from the combined measurements
  • measure.png contains a plot with which you can visually inspect the response times of the individual runs and everything combined
  • measure.p is the Gnuplot script used to create above plot

Compare

Compare any number of measurements you took before. The result will be a combined boxplot.

For each measurement you want to incorporate into the comparison, provide the combined.dat datafile (or another ab gnuplot output file) and an appropriate label.

./abrunner.js compare -i results/foo/combined.dat results/bar/combined.dat -l "Foo" "Bar" -o results/comparison

Results

Running this command will create a bunch of outputs:

  • run*.dat files are a copy of the input files
  • run*.stats files contain some statistics collected from the input file
  • compare.png contains a plot comparing all input files
  • compare.p is the Gnuplot script used to create above plot

The comparison plot will look something like this:

Example comparison plot

Troubleshooting

When running a new measurement, the iteration*.out file captures the ab output. Sometimes this contains an error that helps you pinpoint the problem.

If you run ab against a domain, make sure it ends with a /. If the url includes a path this should not be a problem.

The output.log file always contains always contains a list of the command input and all commands that were run. If somehow the input arguments are not parsed correctly, you should be able to spot that here.

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.