Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ cache
*/myenv
warehouse

node_modules/
iceberg-data/


# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python
Expand Down
48 changes: 48 additions & 0 deletions performance-examples/duckdb-query/artillery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Artillery GraphQL Load Test

This directory contains Artillery load tests for the DataSQRL GraphQL API.

## Prerequisites

Install Artillery:
```bash
npm install -g artillery@latest
```

## Running the Test

Basic run:
```bash
npm test
```

## Test Configuration

- **Target**: `http://localhost:8888`
- **Duration**: 60 seconds
- **Rate**: 10 queries per second
- **Query**: MetricsByTime with random machineid (1-99)

## Metrics Reported

Artillery will report:
- **Latency percentiles**: p50, p75, p90, p95, p99
- **Request rate**: requests per second
- **Error rate**: percentage of failed requests
- **Response codes**: distribution of HTTP status codes
- **Scenarios completed**: number of successful test scenarios

## Performance Thresholds

The test includes assertions:
- Max error rate: 1%
- p95 latency: < 1000ms
- p99 latency: < 2000ms

## Customization

Edit `graphql-load-test.yml` to:
- Change load pattern (phases)
- Modify query variables
- Adjust performance thresholds
- Add more scenarios
33 changes: 33 additions & 0 deletions performance-examples/duckdb-query/artillery/graphql-load-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
config:
target: "http://localhost:8888"
phases:
- duration: 60
arrivalRate: 25
name: "Sustained load - 25 QPS"
plugins:
metrics-by-endpoint:
stripQueryString: true
ensure:
maxErrorRate: 1
p95: 1000
p99: 2000

scenarios:
- name: "MetricsByTime Query"
engine: http
flow:
- post:
url: "/v1/graphql"
headers:
Content-Type: "application/json"
json:
query: |
query MetricsByTimeQuery($machineid: Int!, $fromTime: String!) {
MetricsByTime(machineid: $machineid, fromTime: $fromTime) {
avg_metric
total_count
}
}
variables:
machineid: "{{ $randomNumber(1, 99) }}"
fromTime: "2024-01-01T00:00:00Z"
Loading
Loading