mirror of
https://github.com/aykhans/sarin.git
synced 2026-01-13 20:11:21 +00:00
Add URL path templating support with validation and documentation
This commit is contained in:
22
README.md
22
README.md
@@ -74,18 +74,6 @@ Send 10,000 GET requests with 50 concurrent connections and a random User-Agent
|
||||
sarin -U http://example.com -r 10_000 -c 50 -H "User-Agent: {{ fakeit_UserAgent }}"
|
||||
```
|
||||
|
||||
Example output:
|
||||
|
||||
```
|
||||
┌──────────┬───────┬──────────┬───────────┬─────────┬───────────┬──────────┬───────────┐
|
||||
│ Response │ Count │ Min │ Max │ Average │ P90 │ P95 │ P99 │
|
||||
├──────────┼───────┼──────────┼───────────┼─────────┼───────────┼──────────┼───────────┤
|
||||
│ 200 │ 10000 │ 78.038ms │ 288.153ms │ 94.71ms │ 103.078ms │ 131.08ms │ 269.218ms │
|
||||
├──────────┼───────┼──────────┼───────────┼─────────┼───────────┼──────────┼───────────┤
|
||||
│ Total │ 10000 │ 78.038ms │ 288.153ms │ 94.71ms │ 103.078ms │ 131.08ms │ 269.218ms │
|
||||
└──────────┴───────┴──────────┴───────────┴─────────┴───────────┴──────────┴───────────┘
|
||||
```
|
||||
|
||||
Run a 5-minute duration-based test:
|
||||
|
||||
```sh
|
||||
@@ -112,15 +100,15 @@ For detailed documentation on all configuration options (URL, method, timeout, c
|
||||
|
||||
## Templating
|
||||
|
||||
Sarin supports Go templates in methods, bodies, headers, params, cookies, and values. Use the 320+ built-in functions to generate dynamic data for each request.
|
||||
Sarin supports Go templates in URL paths, methods, bodies, headers, params, cookies, and values. Use the 320+ built-in functions to generate dynamic data for each request.
|
||||
|
||||
**Example:**
|
||||
|
||||
```sh
|
||||
sarin -U http://example.com/users \
|
||||
-V "ID={{ fakeit_UUID }}" \
|
||||
-H "X-Request-ID: {{ .Values.ID }}" \
|
||||
-B '{"id": "{{ .Values.ID }}"}'
|
||||
sarin -U "http://example.com/users/{{ fakeit_UUID }}" -r 1000 -c 10 \
|
||||
-V "RequestID={{ fakeit_UUID }}" \
|
||||
-H "X-Request-ID: {{ .Values.RequestID }}" \
|
||||
-B '{"request_id": "{{ .Values.RequestID }}"}'
|
||||
```
|
||||
|
||||
For the complete templating guide and functions reference, see the **[Templating Guide](docs/templating.md)**.
|
||||
|
||||
Reference in New Issue
Block a user