All Projects β†’ rogerwelin β†’ Cassowary

rogerwelin / Cassowary

Licence: mit
πŸš€ Modern cross-platform HTTP load-testing tool written in Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Cassowary

Performance Plugin
Performance Test Running and Reporting for Jenkins CI
Stars: ✭ 176 (-63.93%)
Mutual labels:  performance, load-testing
Fmt
A modern formatting library
Stars: ✭ 12,698 (+2502.05%)
Mutual labels:  cross-platform, performance
Bombardier
Fast cross-platform HTTP benchmarking tool written in Go
Stars: ✭ 2,952 (+504.92%)
Mutual labels:  performance, load-testing
Goose
Load testing tool, inspired by Locust
Stars: ✭ 151 (-69.06%)
Mutual labels:  performance, load-testing
Performance Testing Framework
Framework allows to perform load testing with Apache Jmeter, view application/server metrics in real-time with Grafana, analyze errors cause with detailed traces for failed requests, compare different test runs in scripted dashboard and perform frontend performance testing with sitespeed.io+webpagetest
Stars: ✭ 275 (-43.65%)
Mutual labels:  performance, load-testing
K6
A modern load testing tool, using Go and JavaScript - https://k6.io
Stars: ✭ 14,829 (+2938.73%)
Mutual labels:  performance, load-testing
Yyjson
The fastest JSON library in C
Stars: ✭ 1,894 (+288.11%)
Mutual labels:  cross-platform, performance
Easy.logger
A modern, high performance cross platform wrapper for Log4Net.
Stars: ✭ 118 (-75.82%)
Mutual labels:  cross-platform, performance
Kboom
The Kubernetes scale & soak load tester
Stars: ✭ 256 (-47.54%)
Mutual labels:  performance, load-testing
Easy.messagehub
No need for .NET Events! A thread-safe, high performance & easy to use cross platform implementation of the Event Aggregator Pattern.
Stars: ✭ 208 (-57.38%)
Mutual labels:  cross-platform, performance
Gatling Dubbo
A gatling plugin for running load tests on Apache Dubbo(https://github.com/apache/incubator-dubbo) and other java ecosystem.
Stars: ✭ 131 (-73.16%)
Mutual labels:  performance, load-testing
Predator
A powerful open-source platform for load testing APIs.
Stars: ✭ 356 (-27.05%)
Mutual labels:  performance, load-testing
Taurus
Automation-friendly framework for Continuous Testing by
Stars: ✭ 1,566 (+220.9%)
Mutual labels:  performance, load-testing
Yandex Tank
Load and performance benchmark tool
Stars: ✭ 2,110 (+332.38%)
Mutual labels:  performance, load-testing
Timemory
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
Stars: ✭ 192 (-60.66%)
Mutual labels:  cross-platform, performance
Recyclerlistview
High performance listview for React Native and web!
Stars: ✭ 4,033 (+726.43%)
Mutual labels:  cross-platform, performance
Libcopp
cross-platform coroutine library in c++
Stars: ✭ 398 (-18.44%)
Mutual labels:  cross-platform, performance
Android Tips Tricks
β˜‘οΈ [Cheatsheet] Tips and tricks for Android Development
Stars: ✭ 4,496 (+821.31%)
Mutual labels:  performance
Garie
Open source web performance
Stars: ✭ 484 (-0.82%)
Mutual labels:  performance
Processhacker
A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Stars: ✭ 6,285 (+1187.91%)
Mutual labels:  performance

cassowary

Go Report Card Build status Mentioned in Awesome Go Go version Current Release godoc Coverage License

English | δΈ­ζ–‡

Cassowary is a modern HTTP/S, intuitive & cross-platform load testing tool built in Go for developers, testers and sysadmins. Cassowary draws inspiration from awesome projects like k6, ab & httpstat.


Toc

Features

  • 2 Load Testing modes: one standard and one spread mode where URL Paths can be specified from a file (ideal if you want to hit several underlying microservices)
  • CI Friendly: Well-suited to be part of a CI pipeline step
  • Flexible metrics: Cloudwatch metrics, Prometheus metrics (pushing metrics to Prometheus PushGateway), JSON file
  • Configurable: Able to pass in arbitrary HTTP headers, able to configure the HTTP client
  • Supports GET, POST, PUT & PATCH - POST, PUT and PATCH data can be defined in a file
  • Cross Platform: One single pre-built binary for Linux, Mac OSX and Windows
  • Importable - Besides the CLI tool cassowary can be imported as a module in your Go app
  • Visualizations - Cassowary can export request data as a histogram and boxplot in png format

Installation

Grab a pre-built binary from the GitHub Releases page. You can optionally put the cassowary binary in your PATH so you can run cassowary from any location. Alternative you can:

Homebrew on Mac OSX

You can install cassowary using the Homebrew package manager on Mac:

$ brew update && brew install cassowary

Docker

You can run cassowary directly by using it's Docker image:

$ docker run rogerw/cassowary:v0.14.0 cassowary run -u http://www.example.com -c 1 -n 10

Nix/NixOS

Cassowary can be installed via the Nix package manager.

nix-env -iA cassowary

CentOS/RHEL (RPM)

If you want to roll out your own RPM you can use the spec file cassowary.spec to build an RPM package

Running Cassowary

Regular Load Test

Example running cassowary against www.example.com with 100 requests spread out over 10 concurrent users:

$ ./cassowary run -u http://www.example.com -c 10 -n 100

Starting Load Test with 100 requests using 10 concurrent users

 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| [1s:0s]            1.256773616s


 TCP Connect.....................: Avg/mean=101.90ms 	Median=102.00ms	p(95)=105ms
 Server Processing...............: Avg/mean=100.18ms 	Median=100.50ms	p(95)=103ms
 Content Transfer................: Avg/mean=0.01ms 	Median=0.00ms	p(95)=0ms

Summary:
 Total Req.......................: 100
 Failed Req......................: 0
 DNS Lookup......................: 115.00ms
 Req/s...........................: 79.57

File Slurp Mode

Example running cassowary in file slurp mode where all URL paths are specified from an external file (which can also be fetched from http if specified). By default cassowary will, without the -n flag specified, make one request per path specified in the file. However with the -n flag you can also specify how many request you want cassowary to generate against those URL paths. Example:

$ ./cassowary run -u http://localhost:8000 -c 1 -f urlpath.txt

# NOTE: from v0.10.0 and below file slurp mode had it's own command
# $ ./cassowary run-file -u http://localhost:8000 -c 1 -f urlpath.txt

Starting Load Test with 5 requests using 1 concurrent users

[ omitted ]


$ ./cassowary run -u http://localhost:8000 -c 10 -n 100 -f urlpath.txt

Starting Load Test with 100 requests using 10 concurrent users

 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| [0s:0s]            599.467161ms


 TCP Connect.....................: Avg/mean=1.80ms 	Median=2.00ms	p(95)=3ms
 Server Processing...............: Avg/mean=0.90ms 	Median=0.00ms	p(95)=3ms
 Content Transfer................: Avg/mean=0.00ms 	Median=0.00ms	p(95)=0ms

Summary:
 Total Req.......................: 3925
 Failed Req......................: 0
 DNS Lookup......................: 2.00ms
 Req/s...........................: 6547.48

Exporting Metrics to File

Example exporting cassowary json metrics to a file:

$ ./cassowary run --json-metrics --json-metrics-file=metrics.json -u http://localhost:8000 -c 125 -n 100000

Starting Load Test with 100000 requests using 125 concurrent users

 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| [0s:0s]            984.9862ms


 TCP Connect.....................: Avg/mean=-0.18ms     Median=0.00ms   p(95)=1ms
 Server Processing...............: Avg/mean=0.16ms      Median=0.00ms   p(95)=1ms
 Content Transfer................: Avg/mean=0.01ms      Median=0.00ms   p(95)=0ms

Summary:
 Total Req.......................: 100000
 Failed Req......................: 0
 DNS Lookup......................: 2.00ms
 Req/s...........................: 101524.27

If json-metrics-file flag is missing then the default filename is out.json.

Exporting Metrics to Prometheus

Example exporting cassowary metrics to Prometheus by supplying an Prometheus PushGatway URL:

$ ./cassowary run -u http://localhost:8000 -c 125 -n 100000 -p http://pushgatway:9091

Starting Load Test with 100000 requests using 125 concurrent users

[ omitted for brevity ]

Exporting Metrics to Cloudwatch

Cassowary can export metrics to AWS Cloudwatch just by adding the --cloudwatch flag without a value. Take note that you will need to tell Cassoway which AWS Region you want to use. The easiest way is using an environment variable as shown below:

$ export AWS_REGION=eu-north-1 && ./cassowary run -u http://localhost:8000 -c 125 -n 100000 --cloudwatch

Starting Load Test with 100000 requests using 125 concurrent users

[ omitted for brevity ]

Histogram

Supply the --histogram flag without a value to let cassowary compute and output a histogram in png format (hist.png in current dir) for the total duration of the requests in ms. Example:

Boxplot

Supply the --boxplot flag without a value to tell cassowary to generate a boxplot visualization in png format (boxplot.png in current dir) for the total duration of the requests in ms

Load Test with POST Data

Example hitting a POST endpoint where POST json data is defined in a file:

$ ./cassowary run -u http://localhost:8000/add-user -c 10 -n 1000 --postfile user.json

Starting Load Test with 1000 requests using 10 concurrent users

[ omitted for brevity ]

Load Test with PATCH Data

Example hitting a PATCH endpoint where PATCH json data is defined in a file:

$ ./cassowary run -u http://localhost:8000/add-user -c 5 -n 200 --patchfile user.json

Starting Load Test with 200 requests using 5 concurrent users

[ omitted for brevity ]

Specifying a Duration for the Load Test

Example specifying a duration for your load test, in the command below we specify that we want send 100 requests over a duration of 30 seconds:

$ ./cassowary run -u http://localhost:8000 -n 100 -d 30

Starting Load Test with 100 requests using 1 concurrent users

[ omitted for brevity ]

Adding HTTP Headers

Example adding an HTTP header when running cassowary

$ ./cassowary run -u http://localhost:8000 -c 10 -n 1000 -H 'Host: www.example.com'

Starting Load Test with 1000 requests using 10 concurrent users

[ omitted for brevity ]

Disabling HTTP keep-alive

Example disabling http keep-alive (by default keep-alive are enabled):

$ ./cassowary run -u http://localhost:8000 -c 10 -n 1000 --disable-keep-alive

Starting Load Test with 1000 requests using 10 concurrent users

[ omitted for brevity ]

Specifying ca certificate

Example specifying ca certificate

$ ./cassowary run -u http://localhost:8000 -c 10 -n 1000 --ca /path/to/ca.pem

Starting Load Test with 1000 requests using 10 concurrent users

[ omitted for brevity ]

x509 Authentication

Example specifying client authentication for mTLS

$ ./cassowary run -u https://localhost:8443 -c 10 -n 1000 --cert /path/to/client.pem --key /path/to/client-key.pem --ca /path/to/ca.pem

Starting Load Test with 1000 requests using 10 concurrent users

[ omitted for brevity ]

Distributed Load Testing

You can run cassowary in a distributed way if you need to scale up the load testing on more than one machine. Simplest way to do that is having access to a Kubernetes cluster. Use the batch type in Kubernetes and in the spec.paralellism key you can specify how many instances of cassowary you want to run simultaneously:

apiVersion: batch/v1
kind: Job
metadata:
  name: cassowary
spec:
  parallelism: 10
  template:
    spec:
      containers:
      - command: ["cassowary", "run", "-u", "http://my-microservice.com:8000", "-c", "1", "-n", "10"]
        image: rogerw/cassowary:v0.14.0
        name: cassowary
      restartPolicy: Never

Just apply this yaml like so:

$ kubectl apply -f cassowary.yaml

Importing cassowary as a module/library

Cassowary can be imported and used as a module in your Go app. Start by fetching the dependency by using go mod:

$ go mod init test && go get github.com/rogerwelin/cassowary/pkg/client

And below show a simple example on how to trigger a load test from your code and printing the results:

package main

import (
        "encoding/json"
	"fmt"

	"github.com/rogerwelin/cassowary/pkg/client"
)

func main() {
	cass := &client.Cassowary{
		BaseURL:               "http://www.example.com",
		ConcurrencyLevel:      1,
		Requests:              10,
		DisableTerminalOutput: true,
	}
	metrics, err := cass.Coordinate()
	if err != nil {
		panic(err)
	}

        // print results
	fmt.Printf("%+v\n", metrics)

        // or print as json
	jsonMetrics, err := json.Marshal(metrics)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(jsonMetrics))
}

More library examples can be found here

Versioning

Cassowary follows semantic versioning. The public library (pkg/client) may break backwards compatibility until it hits a stable v1.0.0 release.

Contributing

Contributions are welcome! To request a feature create a new issue with the label feature-request. Find a bug? Please add an issue with the label bugs. Pull requests are also welcomed but please add an issue on the requested feature first (unless it's a simple bug fix or readme change)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].