This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +74
-38
lines changed Expand file tree Collapse file tree 9 files changed +74
-38
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,7 @@ services:
28
28
- GF_AUTH_ANONYMOUS_ENABLED=true
29
29
- GF_AUTH_BASIC_ENABLED=false
30
30
volumes :
31
- - ./example/config-datasources.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
32
- - ./example/config-dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
33
- - ./example/dashboards:/var/lib/grafana/dashboards
31
+ - ./grafana:/etc/grafana/provisioning/
34
32
35
33
k6 :
36
34
build : .
@@ -43,3 +41,5 @@ services:
43
41
- K6_OUT=output-prometheus-remote
44
42
depends_on :
45
43
- prometheus
44
+ volumes :
45
+ - ./samples:/scripts
File renamed without changes.
Original file line number Diff line number Diff line change 24
24
"editable" : true ,
25
25
"fiscalYearStartMonth" : 0 ,
26
26
"graphTooltip" : 0 ,
27
- "iteration" : 1657475182972 ,
27
+ "iteration" : 1660431009407 ,
28
28
"links" : [],
29
29
"liveNow" : false ,
30
30
"panels" : [
1562
1562
{
1563
1563
"allValue" : " " ,
1564
1564
"current" : {
1565
- "selected" : true ,
1566
- "text" : " test-1657474791 " ,
1567
- "value" : " test-1657474791 "
1565
+ "selected" : false ,
1566
+ "text" : " All " ,
1567
+ "value" : " $__all "
1568
1568
},
1569
1569
"datasource" : {
1570
1570
"type" : " prometheus" ,
1581
1581
"query" : " label_values(testid)" ,
1582
1582
"refId" : " StandardVariableQuery"
1583
1583
},
1584
- "refresh" : 1 ,
1584
+ "refresh" : 2 ,
1585
1585
"regex" : " " ,
1586
1586
"skipUrlSync" : false ,
1587
1587
"sort" : 1 ,
1624
1624
"timezone" : " " ,
1625
1625
"title" : " Test Result" ,
1626
1626
"uid" : " a21-pyAWz" ,
1627
- "version" : 3 ,
1627
+ "version" : 1 ,
1628
1628
"weekStart" : " "
1629
- }
1629
+ }
Original file line number Diff line number Diff line change 24
24
"editable" : true ,
25
25
"fiscalYearStartMonth" : 0 ,
26
26
"graphTooltip" : 0 ,
27
+ "iteration" : 1660431147457 ,
27
28
"links" : [],
28
29
"liveNow" : false ,
29
30
"panels" : [
143
144
"type" : " prometheus" ,
144
145
"uid" : " PEDF09670F151C95C"
145
146
},
146
- "editorMode" : " builder " ,
147
- "expr" : " k6_http_reqs" ,
147
+ "editorMode" : " code " ,
148
+ "expr" : " k6_http_reqs{testid=~ \" $testid \" } " ,
148
149
"format" : " table" ,
149
150
"legendFormat" : " __auto" ,
150
151
"range" : true ,
251
252
"style" : " dark" ,
252
253
"tags" : [],
253
254
"templating" : {
254
- "list" : []
255
+ "list" : [
256
+ {
257
+ "current" : {
258
+ "selected" : true ,
259
+ "text" : " All" ,
260
+ "value" : " $__all"
261
+ },
262
+ "definition" : " label_values(testid)" ,
263
+ "hide" : 0 ,
264
+ "includeAll" : true ,
265
+ "label" : " Test ID" ,
266
+ "multi" : false ,
267
+ "name" : " testid" ,
268
+ "options" : [],
269
+ "query" : {
270
+ "query" : " label_values(testid)" ,
271
+ "refId" : " StandardVariableQuery"
272
+ },
273
+ "refresh" : 2 ,
274
+ "regex" : " " ,
275
+ "skipUrlSync" : false ,
276
+ "sort" : 1 ,
277
+ "type" : " query"
278
+ }
279
+ ]
255
280
},
256
281
"time" : {
257
282
"from" : " now-1h" ,
261
286
"timezone" : " " ,
262
287
"title" : " Test Runs List" ,
263
288
"uid" : " UoYDJHJZk" ,
264
- "version" : 2 ,
289
+ "version" : 1 ,
265
290
"weekStart" : " "
266
- }
291
+ }
Original file line number Diff line number Diff line change 1
- # For configuration options, see
1
+ # For configuration options, see
2
2
# https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards
3
3
4
4
apiVersion : 1
5
5
6
6
providers :
7
7
# We're defining a directory from which to load file-based dashboards
8
- - name : ' a unique provider name '
8
+ - name : ' prometheus-in-docker '
9
9
type : file
10
10
disableDeletion : false
11
11
updateIntervalSeconds : 10
12
- allowUiUpdates : false
12
+ editable : true
13
13
options :
14
- path : /var/lib/grafana/dashboards
15
- foldersFromFilesStructure : true
14
+ path : /etc/grafana/provisioning/dashboards
Original file line number Diff line number Diff line change 24
24
"editable" : true ,
25
25
"fiscalYearStartMonth" : 0 ,
26
26
"graphTooltip" : 1 ,
27
- "iteration" : 1657476390215 ,
27
+ "iteration" : 1660431508579 ,
28
28
"links" : [],
29
29
"liveNow" : true ,
30
30
"panels" : [
796
796
"mode" : " absolute" ,
797
797
"steps" : [
798
798
{
799
- "color" : " green" ,
800
- "value" : null
799
+ "color" : " green"
801
800
},
802
801
{
803
802
"color" : " red" ,
886
885
"mode" : " absolute" ,
887
886
"steps" : [
888
887
{
889
- "color" : " green" ,
890
- "value" : null
888
+ "color" : " green"
891
889
}
892
890
]
893
891
},
942
940
"mode" : " absolute" ,
943
941
"steps" : [
944
942
{
945
- "color" : " green" ,
946
- "value" : null
943
+ "color" : " green"
947
944
}
948
945
]
949
946
},
1027
1024
"mode" : " absolute" ,
1028
1025
"steps" : [
1029
1026
{
1030
- "color" : " green" ,
1031
- "value" : null
1027
+ "color" : " green"
1032
1028
}
1033
1029
]
1034
1030
},
1231
1227
"mode" : " absolute" ,
1232
1228
"steps" : [
1233
1229
{
1234
- "color" : " green" ,
1235
- "value" : null
1230
+ "color" : " green"
1236
1231
}
1237
1232
]
1238
1233
}
1388
1383
{
1389
1384
"allValue" : " http.*" ,
1390
1385
"current" : {
1391
- "selected" : true ,
1386
+ "selected" : false ,
1392
1387
"text" : " All" ,
1393
1388
"value" : " $__all"
1394
1389
},
1406
1401
"query" : " label_values(url)" ,
1407
1402
"refId" : " StandardVariableQuery"
1408
1403
},
1409
- "refresh" : 1 ,
1404
+ "refresh" : 2 ,
1410
1405
"regex" : " " ,
1411
1406
"skipUrlSync" : false ,
1412
1407
"sort" : 0 ,
1413
1408
"type" : " query"
1414
1409
},
1415
1410
{
1416
1411
"current" : {
1417
- "selected" : true ,
1412
+ "selected" : false ,
1418
1413
"text" : " All" ,
1419
1414
"value" : " $__all"
1420
1415
},
1432
1427
"query" : " label_values(scenario)" ,
1433
1428
"refId" : " StandardVariableQuery"
1434
1429
},
1435
- "refresh" : 1 ,
1430
+ "refresh" : 2 ,
1436
1431
"regex" : " " ,
1437
1432
"skipUrlSync" : false ,
1438
1433
"sort" : 0 ,
1543
1538
"query" : " label_values(method)" ,
1544
1539
"refId" : " StandardVariableQuery"
1545
1540
},
1546
- "refresh" : 1 ,
1541
+ "refresh" : 2 ,
1547
1542
"regex" : " " ,
1548
1543
"skipUrlSync" : false ,
1549
1544
"sort" : 0 ,
1559
1554
"timezone" : " " ,
1560
1555
"title" : " PRW output of k6" ,
1561
1556
"uid" : " 5cQoNs67k" ,
1562
- "version" : 2 ,
1557
+ "version" : 1 ,
1563
1558
"weekStart" : " "
1564
- }
1559
+ }
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ import http from "k6/http" ;
2
+ import { check } from "k6" ;
3
+
4
+ export const options = {
5
+ vus : 10 ,
6
+ duration : '10s' ,
7
+ thresholds : {
8
+ 'http_reqs{expected_response:true}' : [ 'rate>10' ] ,
9
+ } ,
10
+ } ;
11
+
12
+ export default function ( ) {
13
+ check ( http . get ( "https://test-api.k6.io/" ) , {
14
+ "status is 200" : ( r ) => r . status == 200 ,
15
+ "protocol is HTTP/2" : ( r ) => r . proto == "HTTP/2.0" ,
16
+ } ) ;
17
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments