https://github.com/sile/jlot
Command-line tool for JSON-RPC 2.0 over JSON Lines over TCP.
https://github.com/sile/jlot
command-line-tool json-rpc jsonl rust
Last synced: 5 months ago
JSON representation
Command-line tool for JSON-RPC 2.0 over JSON Lines over TCP.
- Host: GitHub
- URL: https://github.com/sile/jlot
- Owner: sile
- License: mit
- Created: 2024-09-04T12:20:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-07T15:46:06.000Z (5 months ago)
- Last Synced: 2026-02-08T00:12:27.021Z (5 months ago)
- Topics: command-line-tool, json-rpc, jsonl, rust
- Language: Rust
- Homepage:
- Size: 217 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jlot
====
[](https://crates.io/crates/jlot)
[](https://docs.rs/jlot)
[](https://github.com/sile/jlot/actions)

This is a command-line tool for [JSON-RPC 2.0] over [JSON Lines] over TCP.
[JSON-RPC 2.0]: https://www.jsonrpc.org/specification
[JSON Lines]: https://jsonlines.org/
```console
$ cargo install jlot
$ jlot -h
Command-line tool for JSON-RPC 2.0 over JSON Lines over TCP
Usage: jlot [OPTIONS]
Commands:
req Generate a JSON-RPC request object JSON
call Read JSON-RPC requests from standard input and execute the RPC calls
bench Run JSON-RPC benchmark
stats Calculate statistics from JSON objects outputted by the bench command
echo-server Run a JSON-RPC echo server (for development or testing purposes)
Options:
--version Print version
-h, --help Print help ('--help' for full help, '-h' for summary)
```
Examples
--------
### Basic RPC call
Start an echo server in a terminal (":9000" is shorthand for "127.0.0.1:9000"):
```console
$ jlot echo-server :9000
```
Execute an RPC call in another terminal:
```console
$ jlot req hello --params '["world"]' | jlot call :9000 | jq .
{
"jsonrpc": "2.0",
"result": {
"id": 2,
"jsonrpc": "2.0",
"method": "hello",
"params": [
"world"
]
},
"id": 2
}
```
### Benchmarking
Start an echo server in a terminal:
```console
$ jlot echo-server :9000
```
Execute 100,000 RPC calls in benchmarking mode and gather the statistics:
```console
$ jlot req put --count 100000 | \
jlot bench :9000 --concurrency 10 | \
jlot stats
{
"elapsed_seconds": 0.356318,
"requests_per_second": 280648,
"avg_latency_seconds": 0.000034634,
"detail": {
"count": { "success": 100000, "error": 0 },
"size": { "request_avg_bytes": 43, "response_avg_bytes": 81 },
"latency": { "min": 0.000013, "p25": 0.000024, "p50": 0.000028, "p75": 0.000035, "max": 0.038994 },
"concurrency": { "max": 10 }
}
}
```
UDP
---
UDP is supported for simple testing with one-packet request/response.
```console
$ jlot echo-server --udp :9001
$ jlot req hello --params '["world"]' | jlot call --udp :9001
```