Skip to content

Latest commit

 

History

History
94 lines (55 loc) · 3.88 KB

README.md

File metadata and controls

94 lines (55 loc) · 3.88 KB

Mittens

Build Status License GitHub site

Mittens

Mittens is a tool that can be used to warm up an http application over REST or gRPC.

Features

Mittens can run as a standalone command-line tool, as a linked Docker container, or even as a sidecar in Kubernetes.

Its main features are summarised below:

  • Sends requests continuously for X seconds
  • Supports REST and gRPC
  • Supports HTTP and gRPC headers
  • Supports concurrent requests
  • Provides files or/and endpoints that can be used as liveness/readiness probes in Kubernetes

Usage

The application receives a number of command-line flags. It also supports reading configs from a JSON file. Read the documentation for more context.

How to build and run

Mittens is written in Go and the simplest way to run it is as a cmd application. It receives a number of command line arguments (see Flags).

The project uses Go Modules. We provide a Makefile which can be used to generate an executable binary and a Dockerfile if you prefer to run using Docker.

Binary

To build the binary make sure you've installed Go 1.13.

Build binary executable

To build the project run the following:

make build

This will generate a binary executable.

Run unit tests

To run the tests:

make unit-tests

Run integration tests

To run the integration tests:

make integration-tests

Run the executable

To run the binary:

./mittens -target-readiness-path=/health -target-grpc-port=6565 -timeout-seconds=60 -concurrency=3 -http-requests=get:/hotel/potatoes -grpc-requests=service/method:"{\"foo\":\"bar\",\"bar\":\"foo\"}"

Docker

Build image

To build a Docker image named mittens:

make docker

Run container

To run the container:

docker run mittens:latest -target-readiness-path=/health -target-grpc-port=6565 -timeout-seconds=60 -concurrency=3 -http-requests=get:/hotel/potatoes -grpc-requests=service/method:"{\"foo\":\"bar\",\"bar\":\"foo\"}"

Note: If you use Docker for Mac you might need to set the target host (target-http-host, target-grpc-host) to docker.for.mac.localhost, or docker.for.mac.host.internal, or host.docker.internal (depending on your version of Docker) so that your container can resolve localhost.

Contributing

Please refer to our CONTRIBUTING file.

Use Cases

References

Legal

This project is available under the Apache 2.0 License.

Copyright 2019 Expedia, Inc.