Skip to content

Conversation

@jrepp
Copy link
Owner

@jrepp jrepp commented Nov 21, 2025

Summary

  • Implement HTTP API server for prism-loadtest
  • Real-time metrics streaming via WebSocket
  • Concurrent test execution with unique microsecond-precision IDs
  • Embedded web dashboard with live charts
  • Graceful shutdown handling

Features

  • REST API endpoints:
    • POST /api/loadtest/start - Start a new load test
    • POST /api/loadtest/stop/{testId} - Stop a running test
    • GET /api/loadtest/status/{testId} - Get test status
    • GET /api/loadtest/list - List all tests
  • WebSocket endpoint: GET /ws/metrics/{testId} - Stream real-time metrics
  • Dashboard: GET / or GET /dashboard - Embedded HTML interface
  • CORS support for cross-origin requests

Implementation

  • cmd/serve.go - CLI command to start server
  • server/server.go - HTTP server and API handlers (248 lines)
  • server/executor.go - Test execution engine with WebSocket broadcasting (339 lines)
  • server/dashboard.go - Embedded HTML dashboard with Chart.js (453 lines)

Test plan

  • Server starts and accepts connections on port 8091
  • Concurrent tests don't overwrite each other (unique IDs)
  • WebSocket clients receive real-time metrics
  • Graceful shutdown with nil pointer safety
  • Full test suite in next PR

Stack

@mergify mergify bot added go Pull requests that update go code size/xs labels Nov 21, 2025
Implement HTTP API server for prism-loadtest with real-time metrics
streaming via WebSocket. Includes test executor with concurrent test
management, embedded web dashboard, and CORS support.

Features:
- REST API for test lifecycle (start/stop/status/list)
- WebSocket streaming of real-time metrics
- Concurrent test execution with unique IDs
- Embedded HTML dashboard with live charts
- Graceful shutdown handling

User request: "implement tests and integration tests for the prism-loadtest binary to validate it's websocket connection and API is working through automated tests that validate the responses of the server under test"

Co-Authored-By: Claude <noreply@anthropic.com>
@jrepp jrepp force-pushed the loadtest-server-impl branch from e122fb8 to 7779cc5 Compare November 21, 2025 22:22
Changed test ID generation from microsecond to nanosecond timestamps
to prevent collisions when tests start concurrently.

User request: "are all of these changes actually tested? let's move through the PRs and run local tests to validate the PR, then check the CI and respond to any code review"

Co-Authored-By: Claude <noreply@anthropic.com>
@mergify
Copy link

mergify bot commented Dec 5, 2025

This PR has been inactive for 14 days. Please update it or close it if it's no longer needed.

@mergify mergify bot added stale and removed stale labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants