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
47 changes: 31 additions & 16 deletions GrafanaJMeterTemplate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"dashboard": {

"__inputs": [
{
"name": "DS_JMETERDB",
"name": "jmeter",
"label": "jmeterdb",
"description": "",
"type": "datasource",
Expand Down Expand Up @@ -47,7 +49,7 @@
"type": "dashboard"
},
{
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"enable": true,
"iconColor": "rgb(237, 18, 18)",
"iconSize": 17,
Expand Down Expand Up @@ -103,7 +105,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"format": "none",
Expand Down Expand Up @@ -222,7 +224,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"format": "none",
Expand Down Expand Up @@ -348,7 +350,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"format": "percentunit",
Expand Down Expand Up @@ -463,7 +465,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -597,7 +599,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"format": "none",
Expand Down Expand Up @@ -702,7 +704,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -847,7 +849,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -985,7 +987,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -1137,7 +1139,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -1287,7 +1289,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"editable": true,
"error": false,
"fill": 1,
Expand Down Expand Up @@ -1461,7 +1463,7 @@
{
"allValue": ".*",
"current": {},
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"hide": 0,
"includeAll": false,
"label": null,
Expand Down Expand Up @@ -1534,7 +1536,7 @@
{
"allValue": null,
"current": {},
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"hide": 0,
"includeAll": false,
"label": null,
Expand All @@ -1554,7 +1556,7 @@
{
"allValue": ".*",
"current": {},
"datasource": "${DS_JMETERDB}",
"datasource": "jmeterdb",
"hide": 0,
"includeAll": true,
"label": null,
Expand Down Expand Up @@ -1606,4 +1608,17 @@
"title": "JMeter Metric Template",
"uid": "ltaas",
"version": 1
}

},
"overwrite": true,
"inputs": [
{
"name": "jmeterdb",
"label": "jmeterdb",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
]
}
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ Normally you will set this via the Jmeter desktop application to make this easie

Otherwise the graphs on Grafana may not show anything!

(10.) Import the sample jmeter Grafana dashboard (GrafanaJMeterTemplate.json) and select the InfluxDB datasource that was created. Check the progress of the test:

![](img/test_progress.png)

To learn more about the Grafana reporter module and how to make use of it, you can check the following blog post:

Expand Down
6 changes: 5 additions & 1 deletion initialize_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ kubectl -n $namespace exec -ti $master_pod -- chmod 755 /jmeter/load_test

influxdb_svc=`kubectl -n $namespace get svc | grep influxdb | awk '{print $1}'`

kubectl -n $namespace exec -ti $grafana_pod -- curl 'http://admin:[email protected]:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://'$influxdb_svc':8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}'
kubectl -n $namespace exec -ti $grafana_pod -- curl 'http://admin:[email protected]:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://'$influxdb_svc':8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}'

#Import dashboard to grafana
kubectl -n $namespace cp GrafanaJMeterTemplate.json.json $grafana_pod:/tmp
kubectl -n $namespace exec -ti $grafana_pod -- curl -X POST -H "Content-Type: application/json" -d @/tmp/GrafanaJMeterTemplate.json.json "http://admin:admin@localhost:3000/api/dashboards/db"