Skip to content

Commit 48f44d1

Browse files
committed
docker-compose: move & simplify influxdb v1 example
1 parent ac4e143 commit 48f44d1

File tree

6 files changed

+35
-13
lines changed

6 files changed

+35
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# InfluxDB v1
2+
3+
This example shows how to use the k6 performance test with InfluxDB v1.
4+
5+
## Prerequisites
6+
7+
- Docker
8+
- Docker Compose
9+
10+
## Run the example
11+
12+
```bash
13+
docker-compose up -d
14+
```
15+
16+
## Access the k6 performance test dashboard
17+
18+
Open the k6 performance test dashboard in your browser http://localhost:3000/d/Le2Ku9NMk/k6-performance-test
19+
20+
## Run the k6 test
21+
22+
The test will run for 20 iterations and use 5 virtual users.
23+
24+
```bash
25+
k6 -i 20 --vus 5 --out influxdb=http://localhost:8086/k6 run script.js
26+
```
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
version: '3.4'
22

33
networks:
4-
k6:
54
grafana:
65

76
services:
87
influxdb:
98
image: influxdb:1.8
109
networks:
11-
- k6
1210
- grafana
1311
ports:
1412
- "8086:8086"
@@ -27,14 +25,3 @@ services:
2725
- GF_AUTH_BASIC_ENABLED=false
2826
volumes:
2927
- ./grafana:/etc/grafana/provisioning/
30-
31-
k6:
32-
image: grafana/k6:latest
33-
networks:
34-
- k6
35-
ports:
36-
- "6565:6565"
37-
environment:
38-
- K6_OUT=influxdb=http://influxdb:8086/k6
39-
volumes:
40-
- ./examples:/scripts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import http from "k6/http";
2+
import { check } from "k6";
3+
4+
export default function () {
5+
check(http.get("https://quickpizza.grafana.com"), {
6+
"status is 200": (r) => r.status == 200,
7+
"protocol is HTTP/2": (r) => r.proto == "HTTP/2.0",
8+
});
9+
}

0 commit comments

Comments
 (0)