Code Monkey home page Code Monkey logo

latency-service's Introduction

Latency Service

The Latency Service provides accurate Round-Trip-Time (RTT) measurements from the HTTP client in the form of a JSON response.

Key Features

  • API Endpoint for RTT Calculation: Utilize an API endpoint to accurately determine Round-Trip-Time (RTT) from the HTTPS server.
  • Flexible Logging Options: Log the results to a designated log file if logging is enabled, aiding in performance analysis and troubleshooting.
  • Automated Certificate Management: Seamlessly obtain and refresh Let's Encrypt certificates to ensure secure communications.

Configuration

When launching the container or application, make sure to set the following environment variables:

LATENCY_HOST="your_host_here"
LATENCY_DATA_DIRECTORY="your_data_directory_here"
LATENCY_LISTEN_HTTP="your_http_listener_here"
LATENCY_LISTEN_HTTPS="your_https_listener_here"
LATENCY_LETS_ENCRYPT="true_or_false"
LATENCY_LOGGING="true_or_false"
CERT_PATH="your_cert_path_here"
KEY_PATH="your_key_path_here"

Deployment Instructions

Deploy the service as a Docker container on your system using the following steps. Ensure that you utilize --net host for accurate results. Additionally, set up log rotation for the LATENCY_DATA_DIRECTORY/latency.logs file or disable logging by configuring LATENCY_LOGGING.

Example Deployment:

Latency deployment using a LetsEncrypt SSL Certificate auto-generated by the latency-service:

docker run -t -i --name "latency-service" --net host --pull always --rm \
  -v /opt/latency:/data:z \
  -e LATENCY_LETS_ENCRYPT=true \
  -e [email protected] \
  -e LATENCY_HOST=test.latency.g-portal.xyz \
  -e LATENCY_LISTEN_HTTP="127.0.0.1:80" \
  -e LATENCY_LISTEN_HTTPS="127.0.0.1:443" \
  "docker.io/gportal/latency-service:latest"

Latency deployment using a custom SSL Certificate:

docker run -t -i --name "latency-service" --net host --pull always --rm \
  -v /opt/latency:/data:z \
  -v /etc/letsencrypt/live/${LATENCY_HOST}/fullchain.pem:/etc/ssl/origin.crt:ro \
  -v /etc/letsencrypt/live/${LATENCY_HOST}/privkey.pem:/etc/ssl/origin.key:ro \
  -e CERT_PATH=/etc/ssl/origin.crt \
  -e CERT_PATH=/etc/ssl/origin.key \
  -e LATENCY_HOST=test.latency.g-portal.xyz \
  -e LATENCY_LISTEN_HTTPS="127.0.0.1:443" \
  "docker.io/gportal/latency-service:latest"

Sample Response

For example, upon making a GET request to http://127.0.0.1:8443/ping, you will receive a JSON response as follows:

{
  "source_ip": "172.17.0.1",
  "latency_ms": 23,
  "time": "2022-03-10T16:06:38.711462804Z"
}

Experience accurate Round-Trip-Time (RTT) measurement with our Latency Service!

latency-service's People

Contributors

birkneralex avatar msniveau avatar renovate[bot] avatar

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.