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:
2828 - GF_AUTH_ANONYMOUS_ENABLED=true
2929 - GF_AUTH_BASIC_ENABLED=false
3030 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/
3432
3533 k6 :
3634 build : .
@@ -43,3 +41,5 @@ services:
4341 - K6_OUT=output-prometheus-remote
4442 depends_on :
4543 - prometheus
44+ volumes :
45+ - ./samples:/scripts
File renamed without changes.
Original file line number Diff line number Diff line change 2424 "editable" : true ,
2525 "fiscalYearStartMonth" : 0 ,
2626 "graphTooltip" : 0 ,
27- "iteration" : 1657475182972 ,
27+ "iteration" : 1660431009407 ,
2828 "links" : [],
2929 "liveNow" : false ,
3030 "panels" : [
15621562 {
15631563 "allValue" : " " ,
15641564 "current" : {
1565- "selected" : true ,
1566- "text" : " test-1657474791 " ,
1567- "value" : " test-1657474791 "
1565+ "selected" : false ,
1566+ "text" : " All " ,
1567+ "value" : " $__all "
15681568 },
15691569 "datasource" : {
15701570 "type" : " prometheus" ,
15811581 "query" : " label_values(testid)" ,
15821582 "refId" : " StandardVariableQuery"
15831583 },
1584- "refresh" : 1 ,
1584+ "refresh" : 2 ,
15851585 "regex" : " " ,
15861586 "skipUrlSync" : false ,
15871587 "sort" : 1 ,
16241624 "timezone" : " " ,
16251625 "title" : " Test Result" ,
16261626 "uid" : " a21-pyAWz" ,
1627- "version" : 3 ,
1627+ "version" : 1 ,
16281628 "weekStart" : " "
1629- }
1629+ }
Original file line number Diff line number Diff line change 2424 "editable" : true ,
2525 "fiscalYearStartMonth" : 0 ,
2626 "graphTooltip" : 0 ,
27+ "iteration" : 1660431147457 ,
2728 "links" : [],
2829 "liveNow" : false ,
2930 "panels" : [
143144 "type" : " prometheus" ,
144145 "uid" : " PEDF09670F151C95C"
145146 },
146- "editorMode" : " builder " ,
147- "expr" : " k6_http_reqs" ,
147+ "editorMode" : " code " ,
148+ "expr" : " k6_http_reqs{testid=~ \" $testid \" } " ,
148149 "format" : " table" ,
149150 "legendFormat" : " __auto" ,
150151 "range" : true ,
251252 "style" : " dark" ,
252253 "tags" : [],
253254 "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+ ]
255280 },
256281 "time" : {
257282 "from" : " now-1h" ,
261286 "timezone" : " " ,
262287 "title" : " Test Runs List" ,
263288 "uid" : " UoYDJHJZk" ,
264- "version" : 2 ,
289+ "version" : 1 ,
265290 "weekStart" : " "
266- }
291+ }
Original file line number Diff line number Diff line change 1- # For configuration options, see
1+ # For configuration options, see
22# https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards
33
44apiVersion : 1
55
66providers :
77 # We're defining a directory from which to load file-based dashboards
8- - name : ' a unique provider name '
8+ - name : ' prometheus-in-docker '
99 type : file
1010 disableDeletion : false
1111 updateIntervalSeconds : 10
12- allowUiUpdates : false
12+ editable : true
1313 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 2424 "editable" : true ,
2525 "fiscalYearStartMonth" : 0 ,
2626 "graphTooltip" : 1 ,
27- "iteration" : 1657476390215 ,
27+ "iteration" : 1660431508579 ,
2828 "links" : [],
2929 "liveNow" : true ,
3030 "panels" : [
796796 "mode" : " absolute" ,
797797 "steps" : [
798798 {
799- "color" : " green" ,
800- "value" : null
799+ "color" : " green"
801800 },
802801 {
803802 "color" : " red" ,
886885 "mode" : " absolute" ,
887886 "steps" : [
888887 {
889- "color" : " green" ,
890- "value" : null
888+ "color" : " green"
891889 }
892890 ]
893891 },
942940 "mode" : " absolute" ,
943941 "steps" : [
944942 {
945- "color" : " green" ,
946- "value" : null
943+ "color" : " green"
947944 }
948945 ]
949946 },
10271024 "mode" : " absolute" ,
10281025 "steps" : [
10291026 {
1030- "color" : " green" ,
1031- "value" : null
1027+ "color" : " green"
10321028 }
10331029 ]
10341030 },
12311227 "mode" : " absolute" ,
12321228 "steps" : [
12331229 {
1234- "color" : " green" ,
1235- "value" : null
1230+ "color" : " green"
12361231 }
12371232 ]
12381233 }
13881383 {
13891384 "allValue" : " http.*" ,
13901385 "current" : {
1391- "selected" : true ,
1386+ "selected" : false ,
13921387 "text" : " All" ,
13931388 "value" : " $__all"
13941389 },
14061401 "query" : " label_values(url)" ,
14071402 "refId" : " StandardVariableQuery"
14081403 },
1409- "refresh" : 1 ,
1404+ "refresh" : 2 ,
14101405 "regex" : " " ,
14111406 "skipUrlSync" : false ,
14121407 "sort" : 0 ,
14131408 "type" : " query"
14141409 },
14151410 {
14161411 "current" : {
1417- "selected" : true ,
1412+ "selected" : false ,
14181413 "text" : " All" ,
14191414 "value" : " $__all"
14201415 },
14321427 "query" : " label_values(scenario)" ,
14331428 "refId" : " StandardVariableQuery"
14341429 },
1435- "refresh" : 1 ,
1430+ "refresh" : 2 ,
14361431 "regex" : " " ,
14371432 "skipUrlSync" : false ,
14381433 "sort" : 0 ,
15431538 "query" : " label_values(method)" ,
15441539 "refId" : " StandardVariableQuery"
15451540 },
1546- "refresh" : 1 ,
1541+ "refresh" : 2 ,
15471542 "regex" : " " ,
15481543 "skipUrlSync" : false ,
15491544 "sort" : 0 ,
15591554 "timezone" : " " ,
15601555 "title" : " PRW output of k6" ,
15611556 "uid" : " 5cQoNs67k" ,
1562- "version" : 2 ,
1557+ "version" : 1 ,
15631558 "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