prismbench
v1.0.1
Published
Local-first API workbench, Git-native test collections, and high-concurrency load tester
Maintainers
Readme
Prism
Local-first API workbench, Git-native test collections, and high-concurrency load tester.
Designed by Atlas Research Labs as a zero-bloat, private alternative to Postman and k6.
Architecture Principles
- Local-First & Git-Native: Test suites and collections are flat, version-controlled JSON/YAML files stored directly in your repository. No mandatory accounts, no cloud synchronization lock-in.
- Zero-Overhead Concurrency Engine: Native HTTP/HTTPS connection pooling with socket reuse capable of generating high-throughput stress tests without heavy JVM or Electron resource footprints.
- Microsecond Phase Timings: Detailed telemetry on every request: DNS resolution, TCP handshake, TLS negotiation, Time to First Byte (TTFB), and total response lifecycle.
- Embedded OLED Studio: Pure OLED black local Web UI (
http://127.0.0.1:7070) with real-time SSE benchmark streaming, request builder, and assertion reports. - Zero External Dependencies: Implemented entirely with Node.js standard runtime libraries (
http,https,perf_hooks,events). Package size is under 100 KB with idle memory usage under 15 MB.
Installation
Global CLI installation via NPM:
npm install -g prismbenchOr run directly without installation via npx:
npx prismbench --helpBoth binary commands prism and prismbench are exposed.
CLI Reference
1. Single Request Execution
Execute an immediate HTTP request with timing analysis:
# Quick request
prism https://api.github.com
# Detailed request with custom method and headers
prism request https://httpbin.org/post -m POST -H "Content-Type: application/json" -b '{"service":"prism"}'Output includes HTTP status, transfer size, full response headers, formatted body, and a breakdown of DNS, TCP, TLS, TTFB, and total latency.
2. Git-Native Test Collections
Run an automated test suite with environment variable substitution and assertions:
prism run ./tests/api-suite.jsonWith environment overrides:
prism run ./tests/api-suite.json -e ./tests/production.env.jsonCollection Format Example:
{
"name": "User Service Tests",
"env": {
"BASE_URL": "https://api.example.com"
},
"requests": [
{
"name": "Health check",
"method": "GET",
"url": "{{BASE_URL}}/health",
"expect": {
"status": 200,
"maxTime": 500,
"headers": {
"content-type": "application/json"
}
}
},
{
"name": "Authentication",
"method": "POST",
"url": "{{BASE_URL}}/auth/token",
"body": { "client_id": "test_app" },
"extract": {
"AUTH_TOKEN": "token"
},
"expect": {
"status": 200
}
},
{
"name": "Get Profile",
"method": "GET",
"url": "{{BASE_URL}}/profile",
"headers": {
"Authorization": "Bearer {{AUTH_TOKEN}}"
},
"expect": {
"status": 200,
"bodyContains": "username"
}
}
]
}3. High-Concurrency Benchmarking
Execute load and stress testing against any target HTTP/HTTPS endpoint:
# 50 concurrent workers for 15 seconds
prism bench https://httpbin.org/get -c 50 -d 15
# Execute exactly 10,000 requests across 100 workers
prism bench https://httpbin.org/get -c 100 -n 10000Metrics reported:
- Total requests and completion rate
- Throughput (Requests per second & Megabytes per second)
- Latency percentiles: Min, Mean, p50 (Median), p90, p95, p99, Max, StdDev
- HTTP status code breakdown (2xx, 3xx, 4xx, 5xx, errors)
4. Embedded OLED Studio
Launch the local web dashboard:
prism studioOptions:
-p, --port <port>: Port to listen on (default:7070)-h, --host <host>: Bind host address (default:127.0.0.1)
Features:
- Interactive Workbench: Request composer supporting methods, parameters, custom headers, JSON/raw payloads, and Bearer/Basic authentication.
- Latency Inspector: Visual cards showing DNS, TCP, TLS, TTFB, and response duration.
- Live Benchmark Runner: Server-Sent Events (SSE) streaming real-time requests/sec, progress percentage, and latency tables.
- Suite Runner: In-browser test runner displaying step-by-step pass/fail assertions.
Programmatic Usage
Prism can be imported into Node.js scripts or CI/CD pipelines:
const { executeRequest, runCollection, BenchEngine } = require('prismbench');
// Execute single request
const response = await executeRequest({
url: 'https://httpbin.org/get',
method: 'GET'
});
console.log(response.status, response.timings.total);
// Run load benchmark
const bench = new BenchEngine({
url: 'https://httpbin.org/get',
concurrency: 20,
duration: 5
});
const report = await bench.run();
console.log(`Throughput: ${report.requests.rps} req/sec`);Quality & Compliance
- Zero Emojis: Strictly pure ASCII/ANSI logging across CLI, UI, and documentation.
- Zero Mock Data: All metrics originate from real operating system socket events and network payloads.
- Deterministic: Standardized exits (
0on pass,1on failure) for automated CI integration.
License
MIT License. Copyright (c) 2026 Atlas Research Labs.
