latencyd

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: GPL-3.0

README

latencyd

Motivation

A simple http server to simulate network latency.

Installation

go install github.com/4thel00z/latencyd/...@latest

Usage

Latencyd is written for and by dumb people. It has three config flags and two endpoints.

The two endpoints are both GET endpoints, exposed under:

  • http://localhost:${PORT:-8000}/fixed and
  • http://localhost:${PORT:-8000}/random

One is called fixed. It is for sleeping for - you guessed it, a fixed time. The fixed config flag just influences the /fixed endpoint.

The other two start and end are used as such: The server will sleep for start ms. Then it will sleep for a random value in the interval [0, end - start) ms.

There is also a port flag, with which you can set the port of the http server. It defaults to port 8000.

Invocation

After installing via the line above, the server can be invoked as such:

latencyd [--port <default:8000>] [--fixed <fixed-waiting-value-in-ms>] [--start <left-waiting-value-in-ms>] [--end <right-waiting-value-in-ms>]

License

This project is licensed under the GPL-3 license.

Directories

Path Synopsis
cmd
latencyd command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL