Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /debug/rand endpoint #396

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Add /debug/rand endpoint #396

merged 1 commit into from
Aug 25, 2023

Conversation

benbjohnson
Copy link
Collaborator

@benbjohnson benbjohnson commented Aug 25, 2023

This pull request adds a GET /debug/rand endpoint to the internal LiteFS HTTP server. When connected, this endpoint will stream bytes from a PRNG until the client disconnects or a timeout of 1 minute is encountered.

The purpose of the endpoint is to help debug slowness on a replica to see if poor network conditions are the problem.

Usage

Running curl against the endpoint will dump out performance metrics:

$ curl http://$PRIMARY:20202/debug/rand > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2685M    0 2685M    0     0   395M      0 --:--:--  0:00:06 --:--:--  401M

@benbjohnson benbjohnson added the enhancement New feature or request label Aug 25, 2023
@benbjohnson benbjohnson merged commit f040ca3 into main Aug 25, 2023
16 checks passed
@benbjohnson benbjohnson deleted the debug-rand branch August 25, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants