Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LatencyLens

LatencyLens is a lightweight REST API performance testing tool. It sends repeated requests to an endpoint and reports latency, reliability, and stability metrics in a clean UI.

Highlights

  • Test any HTTP/HTTPS REST endpoint.
  • Run load tests from 1 to 100 requests.
  • Support for GET, POST, PUT, DELETE, and PATCH.
  • Detailed metrics: average, fastest, slowest, range, success rate, stability, P50, P95, and P99.
  • Per-request results table with status code and latency.
  • Export test results as JSON or CSV.

Tech Stack

  • Backend: Node.js, Express, Axios
  • Frontend: Vanilla HTML, CSS, JavaScript
  • Runtime metrics: Node perf_hooks
  • Containerization: Docker

Local Setup

Prerequisites

  • Node.js 20+
  • npm

Install

npm install
npm install --prefix backend

Run

npm start

App URL: http://localhost:5000

Dev Mode

npm run dev

Docker

Build Image

docker build -t latencylens .

Run Container

docker run --name latencylens-test -p 5000:5000 latencylens

App URL: http://localhost:5000

Stop and Remove Container

docker stop latencylens-test
docker rm latencylens-test

Environment Variables

Optional variables (set in backend/.env for local non-Docker runs, or in your deployment platform):

PORT=5000
REQUEST_TIMEOUT_MS=10000
WARMUP_REQUESTS=1
MAX_CONCURRENCY=5

API

POST /api/test

Runs a latency test against a target endpoint.

Request Body

{
  "endpoint": "https://api.github.com/users/octocat",
  "requestCount": 10,
  "method": "GET",
  "body": {},
  "headers": {
    "Authorization": "Bearer token"
  }
}

Response (example)

{
  "endpoint": "https://api.github.com/users/octocat",
  "metrics": {
    "totalRequests": 10,
    "successfulRequests": 10,
    "averageLatencyMs": 245.5,
    "fastestLatencyMs": 200.2,
    "slowestLatencyMs": 350.8,
    "responseTimeRangeMs": 150.6,
    "successRatePercent": 100,
    "stabilityScoreMs": 45.3,
    "p50": 240.1,
    "p95": 334.2,
    "p99": 347.6
  },
  "insights": [
    "Reliability is strong with a high success rate across requests."
  ],
  "requests": [
    {
      "index": 1,
      "latencyMs": 231.42,
      "statusCode": 200,
      "success": true,
      "error": null
    }
  ],
  "testedAt": "2026-05-05T10:40:57.943Z"
}

GET /api/health

Health-check endpoint.

Deployment on Render (Docker)

  1. Push the repository to GitHub.
  2. In Render, create a new Web Service.
  3. Choose your repository.
  4. Set environment to Docker.
  5. Add env vars if needed (PORT, REQUEST_TIMEOUT_MS, WARMUP_REQUESTS, MAX_CONCURRENCY).
  6. Deploy.

Render will build and run the app from the root Dockerfile.

Project Structure

LatencyLens/
├── backend/
│   ├── server.js
│   ├── package.json
│   └── package-lock.json
├── frontend/
│   ├── index.html
│   ├── app.js
│   ├── styles.css
│   ├── mobile.css
│   └── about/
│       └── index.html
├── Dockerfile
├── .dockerignore
├── package.json
└── README.md

About

A lightweight REST API performance testing tool that requests to an endpoint and reports latency, reliability, stability and different metrics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages