diff --git a/GrafanaJMeterTemplate.json b/GrafanaJMeterTemplate.json deleted file mode 100755 index d887fc6..0000000 --- a/GrafanaJMeterTemplate.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_JMETERDB", - "label": "jmeterdb", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "5.2.0" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "5.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "5.0.0" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - }, - { - "datasource": "${DS_JMETERDB}", - "enable": true, - "iconColor": "rgb(237, 18, 18)", - "iconSize": 17, - "lineColor": "rgb(0, 21, 255)", - "name": "Annotation", - "query": "select text,tags,title from \"$retention\".\"events\" where application =~ /$app/ AND $timeFilter", - "showLine": true, - "tagsColumn": "tags", - "textColumn": "text", - "titleColumn": "title" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 1, - "id": null, - "iteration": 1552478455724, - "links": [ - { - "asDropdown": true, - "icon": "dashboard", - "includeVars": true, - "keepTime": true, - "tags": [], - "targetBlank": true, - "tooltip": "", - "type": "dashboards", - "url": "" - } - ], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 35, - "panels": [], - "repeat": null, - "title": "Jmeter Metrics", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 0, - "y": 1 - }, - "id": 19, - "interval": "$granularity", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": " users", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$granularity" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT last(\"startedT\") FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND $timeFilter GROUP BY time($granularity) fill(null)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "meanAT" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - } - ] - } - ], - "thresholds": "", - "title": "Active Users", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 8, - "y": 1 - }, - "id": 17, - "interval": "", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": " TPS", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$granularity" - ], - "type": "time" - } - ], - "measurement": "jmeter", - "policy": "default", - "query": "SELECT sum(\"hit\") / 30 FROM \"$retention\".\"jmeter\" WHERE \"application\" = '$app' AND \"transaction\" = 'all' AND $timeFilter GROUP BY time(30s)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "hit" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - " / 5" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "transaction", - "operator": "=", - "value": "all" - } - ] - } - ], - "thresholds": "", - "title": "Currents hits per Second", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "format": "percentunit", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 16, - "y": 1 - }, - "id": 21, - "interval": "$granularity", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "dsType": "influxdb", - "groupBy": [], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT sum(\"countError\") / sum(\"count\") FROM \"$retention\".\"jmeter\" WHERE \"application\" =~ /$app$/ AND \"transaction\" = 'all' AND $timeFilter", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "countError" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - }, - { - "params": [ - " / sum(\"count\")" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "transaction", - "operator": "=", - "value": "all" - } - ] - } - ], - "thresholds": "0.1,0.2", - "title": "% Errors", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "total" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 4, - "w": 8, - "x": 0, - "y": 5 - }, - "id": 27, - "interval": "$granularity", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null as zero", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "Hits", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$granularity" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT last(\"hit\") / 5 FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND $timeFilter GROUP BY time($granularity) fill(null)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "hit" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - " / 5" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Hits per Second", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": false, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 8, - "x": 8, - "y": 5 - }, - "id": 22, - "interval": "$granularity", - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": true, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "dsType": "influxdb", - "groupBy": [], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT \"hit\" FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND \"statut\" = 'all' AND $timeFilter", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "hit" - ], - "type": "field" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "statut", - "operator": "=", - "value": "all" - } - ] - } - ], - "thresholds": "", - "title": "Total Hits", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "total" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 4, - "w": 8, - "x": 16, - "y": 5 - }, - "id": 28, - "interval": "$granularity", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "Errors", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$granularity" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT mean(\"countError\") / 5 FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND $timeFilter GROUP BY time($granularity) fill(0)", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "countError" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - " / 5" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Errors per Second", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": false, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 36, - "panels": [], - "repeat": null, - "title": "Application Metrics", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 18, - "w": 24, - "x": 0, - "y": 10 - }, - "height": "", - "id": 25, - "interval": "$granularity", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "minSpan": 24, - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "$tag_transaction", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$granularity" - ], - "type": "time" - }, - { - "params": [ - "transaction" - ], - "type": "tag" - } - ], - "hide": false, - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT mean(\"avg\") FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND $timeFilter GROUP BY time($granularity), \"transaction\"", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "avg" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "statut", - "operator": "=", - "value": "all" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Average Response Time", - "tooltip": { - "msResolution": false, - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "transparent": false, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ms", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 18, - "w": 24, - "x": 0, - "y": 28 - }, - "height": "", - "id": 26, - "interval": "$granularity", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "minSpan": 24, - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "$tag_transaction", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "30s" - ], - "type": "time" - }, - { - "params": [ - "transaction" - ], - "type": "tag" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT mean(\"count\") / 5 FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND \"transaction\" <> 'all' AND $timeFilter GROUP BY time($granularity), \"transaction\"", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "count" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - }, - { - "params": [ - " / 30" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "transaction", - "operator": "<>", - "value": "all" - }, - { - "condition": "AND", - "key": "statut", - "operator": "=", - "value": "all" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Transaction Per Second", - "tooltip": { - "msResolution": false, - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "transparent": false, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ops", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 18, - "w": 24, - "x": 0, - "y": 46 - }, - "height": "", - "id": 29, - "interval": "$granularity", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "minSpan": 24, - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "$tag_transaction", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "30s" - ], - "type": "time" - }, - { - "params": [ - "transaction" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT last(\"count\") / 30 FROM \"$retention\".\"jmeter\" WHERE \"application\" =~ /$app$/ AND \"statut\" = 'ko' AND $timeFilter GROUP BY time(30s), \"transaction\" fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "count" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - }, - { - "params": [ - " / 30" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "statut", - "operator": "=", - "value": "ko" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Error Per Second", - "tooltip": { - "msResolution": false, - "shared": false, - "sort": 0, - "value_type": "cumulative" - }, - "transparent": false, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ops", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_JMETERDB}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 18, - "w": 24, - "x": 0, - "y": 64 - }, - "height": "", - "id": 34, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "minSpan": 24, - "nullPointMode": "null", - "percentage": false, - "pointradius": 1, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": true, - "targets": [ - { - "alias": "$tag_transaction - $tag_responseCode : $tag_responseMessage", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "30s" - ], - "type": "time" - }, - { - "params": [ - "responseMessage" - ], - "type": "tag" - }, - { - "params": [ - "responseCode" - ], - "type": "tag" - }, - { - "params": [ - "transaction" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "jmeter", - "policy": "$retention", - "query": "SELECT sum(\"count\") / 5 FROM \"jmeter\" WHERE \"application\" =~ /$app$/ AND \"statut\" = 'ko' AND $timeFilter GROUP BY time($granularity), \"responseCode\" fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "count" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - }, - { - "params": [ - " / 30" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "application", - "operator": "=~", - "value": "/$app$/" - }, - { - "condition": "AND", - "key": "responseCode", - "operator": "!~", - "value": "/^0$|^$/" - }, - { - "condition": "AND", - "key": "transaction", - "operator": "=~", - "value": "/$transaction/" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Error detail", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "transparent": false, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "30s", - "schemaVersion": 16, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_JMETERDB}", - "hide": 0, - "includeAll": false, - "label": null, - "multi": true, - "name": "app", - "options": [], - "query": "SHOW TAG VALUES FROM \"process\" WITH KEY = \"application\"", - "refresh": 2, - "regex": "", - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "SHOW TAG VALUES FROM \"events\" WITH KEY = \"tags\"", - "type": "query", - "useTags": false - }, - { - "allFormat": "regex wildcard", - "auto": false, - "auto_count": 10, - "auto_min": "10s", - "current": { - "text": "1m", - "value": "1m" - }, - "datasource": "jmeterdb", - "hide": 0, - "includeAll": true, - "label": "", - "multi": false, - "multiFormat": "glob", - "name": "granularity", - "options": [ - { - "selected": true, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "15s", - "value": "15s" - }, - { - "selected": false, - "text": "30s", - "value": "30s" - } - ], - "query": "1m,5m,1h,5s,15s,30s", - "refresh": 2, - "regex": "", - "type": "interval" - }, - { - "allValue": null, - "current": {}, - "datasource": "${DS_JMETERDB}", - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "retention", - "options": [], - "query": "SHOW RETENTION POLICIES ON \"jmeterdb\"", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": null, - "tags": [], - "tagsQuery": null, - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_JMETERDB}", - "hide": 0, - "includeAll": true, - "label": null, - "multi": true, - "name": "transaction", - "options": [], - "query": "SHOW TAG VALUES FROM \"jmeter\" WITH KEY IN (\"transaction\",\"application\") where application =~ /$app/ and transaction !~ /all/", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": null, - "tags": [], - "tagsQuery": null, - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": { - "now": true, - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "browser", - "title": "JMeter Metric Template", - "uid": "ltaas", - "version": 1 -} \ No newline at end of file diff --git a/deployLG.sh b/deployLG.sh new file mode 100755 index 0000000..e5195f1 --- /dev/null +++ b/deployLG.sh @@ -0,0 +1,11 @@ +myNamespace='orchestrator' +accountYAML='k8sDefs/kubeorchestratoraccount.yaml' +deployYAML='k8sDefs/kubeorchestrator.yaml' + + +kubectl delete namespace $myNamespace +kubectl create namespace $myNamespace +kubectl get secret azblob -n default -o yaml | sed s/"namespace: default"/"namespace: $myNamespace"/ | kubectl apply -n $myNamespace -f - +kubectl delete clusterrolebinding overseer +kubectl create -n $myNamespace -f $accountYAML +kubectl create -n $myNamespace -f $deployYAML diff --git a/do_a_loop.sh b/do_a_loop.sh new file mode 100755 index 0000000..2d55d1f --- /dev/null +++ b/do_a_loop.sh @@ -0,0 +1,186 @@ +#!/usr/bin/env bash +# Testing outer loop + +# Debug Settings +doBlobUpdate=1 # 0 = disable +doK8s=1 # 0 = disable +doParallelRuns=1 #0= disable + +integerCheck='^[0-9]+$' + +testSubID='33e681ce-910a-44b4-84b8-d07290144803' +testSAName='storannandale' +testContainerName='testcfg' +tempTestDir='temp/testDefs' +testMasterName='currentTests.csv' + +jmxFile='jmx/main.jmx' +jmxDestFile='/tmp/main.jmx' + +payloadScript="payload_script.sh" +payloadDestFile="/tmp/payload_script.sh" + +working_dir='k8sDefs' + + +# Download the Test Definitions from Blob Storage +if [ $doBlobUpdate -ne 0 ] +then + blobToken=`cat /etc/azblob/azblobsas` + az storage blob download-batch --account-name $testSAName -d $tempTestDir -s $testContainerName --sas-token $blobToken + #blobJSON=`az storage blob list -c $testContainerName --account-name $testSAName --subscription $testSubID | jq '.[].name'` + #for curBlobName in $blobJSON + #do + # cleanBlobName=`sed 's/"//g' <<< $curBlobName` + # # download the blob to temp + # curBlobDestFile=$tempTestDir/$cleanBlobName + # echo $curBlobDestFile + # az storage blob download --container-name $testContainerName --account-name $testSAName --subscription $testSubID -n $cleanBlobName -f $curBlobDestFile + # + # done +fi +# Read the Master Test Config +testMasterFile=$tempTestDir/$testMasterName +IFS=$'\n' +masterConfig=`cat $testMasterFile` +for curTestLine in $masterConfig +do + testParamString="" + # TODO - ignore first line + echo $curTestLine + if [[ $curTestLine == CurTest* ]] + then + echo Skipping First Line of Test List + else + IFS=',' read -ra curTestArray <<< $curTestLine + curTestName=${curTestArray[0],,} + curTestEnabled=${curTestArray[1]} + curTestURL=${curTestArray[2]} + curTestParam=${curTestArray[3]} + curTestLoadName=${curTestArray[4]} + curTestFile=$tempTestDir/$curTestLoadName + curTestFile=`echo $curTestFile | tr --delete '\r'` # Windows line endings are the devil + + if [[ $curTestEnabled != TRUE ]] + then + echo Skipping Disabled Test + else + + # Build the script to be injected + echo "Reading definition from $curTestFile" + + IFS=$'\n' + curTestDefText=`cat $curTestFile` + for curTestDefLine in $curTestDefText + do + IFS=',' read -ra testArray <<< "$curTestDefLine" + numUsers=`echo ${testArray[0]} | tr --delete '\r'` + duration=`echo ${testArray[1]} | tr --delete '\r'` + ramp=`echo ${testArray[2]} | tr --delete '\r'` + + if [[ $numUsers == NumUsers* ]] + then + echo Skipping First Line of Test Def + else + + + + echo $curTestDefLine + + # Feed integer string into jmx file and run test + if ! [[ $numUsers =~ $integerCheck && $duration =~ $integerCheck && $ramp =~ $integerCheck ]] + then + echo "Non-integer input detected. Skipping line." + else + # Script created to launch Jmeter tests directly from the current terminal without accessing the jmeter master pod. + # It requires that you supply the path to the jmx file + ((throughputPerMin=$numUsers*60)) + echo $numUsers + echo $duration + echo $ramp + echo $throughputPerMin + + testParamString=$testParamString$numUsers,$duration,$throughputPerMin,$ramp\; + + + + fi + fi + done + # Remove the last character (trailing ;) + testParamString=${testParamString%?} + echo Test Params: $testParamString + # Create K8s & Inject script + if [ $doK8s -ne 0 ] + then + # TODO - check to see if the namespace already exists + workloadTenant=$curTestName + # DEBUG + + # Check if job is currently running + kubectl -n $workloadTenant get pods + podStatus=`kubectl -n $workloadTenant get pods` + if [[ $podStatus == *Running* || $podStatus == *Image* ]] + then + echo Job is still running in $workloadTenant + else + echo No Job in $workloadTenant + echo "Namspace $workloadTenant deleting" + kubectl delete namespace $workloadTenant + + echo "Namspace $workloadTenant creating" + kubectl create namespace $workloadTenant + + echo Cloning Secret # TODO - Talk to Al if this is reasonable. Note assumption that there is a secret to clone from. Al says I can do this with permissions across namespaces + kubectl get secret azblob -n default -o yaml | sed s/"namespace: default"/"namespace: $workloadTenant"/ | kubectl apply -n $workloadTenant -f - + + # Create Master pod details + echo "Creating Jmeter Master" + kubectl create -n $workloadTenant -f $working_dir/jmeter_master_configmap.yaml + + kubectl create -n $workloadTenant -f $working_dir/jmeter_master_deploy.yaml + + + #TODO - make this check on the status of master instead of arbitrary... + echo Waiting for master pod to be ready + sleep 60 + master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` + + echo Copying payload to master pod + # Copy the jmx template to the pod + kubectl cp "$jmxFile" -n $workloadTenant "$master_pod:/$jmxDestFile" + + # Copy the script to the pod + kubectl cp "$payloadScript" -n $workloadTenant "$master_pod:/$payloadDestFile" + + + kubectl exec -ti -n $workloadTenant $master_pod -- chmod 755 $payloadDestFile + + + # TODO - Talk to Al about this - should probably be done in the image. Al agrees + # Moved to the image + #kubectl exec -i -n $workloadTenant $master_pod -- apt-get update + #kubectl exec -i -n $workloadTenant $master_pod -- apt install curl -y --fix-missing + # Not needed - using Azure Files to upload rather than blob kubectl exec -i -n $workloadTenant $master_pod -- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + + # run the script + # TODO - Talk to Al about this - it gets messy in the output! + curDate=`date '+%Y%m%d_%H%M_%S'` + curLogName="/tmp/payloadlog_"$workloadTenant"_"$curDate".txt" + if [ $doParallelRuns -ne 0 ] + then + cmdToExecute=`kubectl exec -it -n $workloadTenant $master_pod -- nohup $payloadDestFile "$curTestURL" "$curTestParam" "$testParamString" >> $curLogName &` + else + cmdToExecute=`kubectl exec -it -n $workloadTenant $master_pod -- $payloadDestFile "$curTestURL" "$curTestParam" "$testParamString"` + fi + echo $cmdToExecute + eval $cmdToExecute + fi + fi + fi + fi + + +done +echo "Complete - sleeping for 30 seconds" +sleep 30 \ No newline at end of file diff --git a/jmeter_cluster_deploy_monitoring.sh b/jmeter_cluster_deploy_monitoring.sh deleted file mode 100755 index 9f64397..0000000 --- a/jmeter_cluster_deploy_monitoring.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash -#Create multiple Jmeter namespaces on an existing kuberntes cluster -#Started On January 23, 2018 - -working_dir=`pwd` -monitoringTenant='jmeter-monitoring' - -echo "checking if kubectl is present" - -if ! hash kubectl 2>/dev/null -then - echo "'kubectl' was not found in PATH" - echo "Kindly ensure that you can acces an existing kubernetes cluster via kubectl" - exit -fi - -kubectl version --short - -echo - -#Check If namespace exists - -kubectl get namespace $monitoringTenant > /dev/null 2>&1 - -if [ $? -eq 0 ] -then - echo "Namespace $monitoringTenant already exists, please delete this namespace and rerun this script" - echo "Current list of namespaces on the kubernetes cluster" - sleep 2 - - kubectl get namespaces | grep -v NAME | awk '{print $1}' - exit 1 -fi - -echo - -echo "Creating Namespace: $monitoringTenant" - -kubectl create namespace $monitoringTenant - -echo "Namspace $monitoringTenant has been created" - -echo - -echo "Number of worker nodes on this cluster is " $nodes - -echo - -echo "Creating Influxdb and the service" - -kubectl create -n $monitoringTenant -f $working_dir/jmeter_influxdb_configmap.yaml - -kubectl create -n $monitoringTenant -f $working_dir/jmeter_influxdb_deploy.yaml - -kubectl create -n $monitoringTenant -f $working_dir/jmeter_influxdb_svc.yaml - -echo "Creating Grafana Deployment" - -kubectl create -n $monitoringTenant -f $working_dir/jmeter_grafana_deploy.yaml - -kubectl create -n $monitoringTenant -f $working_dir/jmeter_grafana_svc.yaml - -echo "Printout Of the $monitoringTenant Objects" - -echo - -kubectl get -n $monitoringTenant all - -## Create jmeter database automatically in Influxdb - -echo "Creating Influxdb jmeter Database" - -## Sleep to allow time for pods to deploy - -sleep 30 - -## Wait until Influxdb Deployment is up and running -## influxdb_status=`kubectl get po -n $monitoringTenant | grep influxdb-jmeter | awk '{print $2}' | grep Running - -influxdb_pod=`kubectl get po -n $monitoringTenant | grep influxdb-jmeter | awk '{print $1}'` -kubectl exec -ti -n $monitoringTenant $influxdb_pod -- influx -execute 'CREATE DATABASE jmeter' - -## Create the influxdb datasource in Grafana - -echo "Creating the Influxdb data source" -grafana_pod=`kubectl get po -n $monitoringTenant | grep jmeter-grafana | awk '{print $1}'` - -## kubectl cp $working_dir/influxdb-jmeter-datasource.json -n $monitoringTenant $grafana_pod:/influxdb-jmeter-datasource.json - -kubectl exec -ti -n $monitoringTenant $grafana_pod -- curl 'http://admin:admin@127.0.0.1:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://jmeter-influxdb:8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}' \ No newline at end of file diff --git a/jmeter_cluster_deploy_test_rig.sh b/jmeter_cluster_deploy_test_rig.sh deleted file mode 100755 index 74623a0..0000000 --- a/jmeter_cluster_deploy_test_rig.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash -#Create multiple Jmeter namespaces on an existing kuberntes cluster -#Started On January 23, 2018 - -working_dir=`pwd` - -echo "checking if kubectl is present" - -if ! hash kubectl 2>/dev/null -then - echo "'kubectl' was not found in PATH" - echo "Kindly ensure that you can acces an existing kubernetes cluster via kubectl" - exit -fi - -kubectl version --short - -echo "Current list of namespaces on the kubernetes cluster:" - -echo - -kubectl get namespaces | grep -v NAME | awk '{print $1}' - -echo - -echo "Enter the name of the new tenant unique name, this will be used to create the namespace" -read workloadTenant -echo - -#Check If namespace exists - -kubectl get namespace $workloadTenant > /dev/null 2>&1 - -if [ $? -eq 0 ] -then - echo "Namespace $workloadTenant already exists, please select a unique name" - echo "Current list of namespaces on the kubernetes cluster" - sleep 2 - - kubectl get namespaces | grep -v NAME | awk '{print $1}' - exit 1 -fi - -echo -echo "Creating Namespace: $workloadTenant" - -kubectl create namespace $workloadTenant - -echo "Namspace $workloadTenant has been created" - -echo - -echo "Creating Jmeter slave nodes" - -nodes=`kubectl get no | egrep -v "master|NAME" | wc -l` - -echo - -echo "Number of worker nodes on this cluster is " $nodes - -echo - -#echo "Creating $nodes Jmeter slave replicas and service" - -echo - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_deploy.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_svc.yaml - -echo "Creating Jmeter Master" - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_configmap.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_deploy.yaml - -echo "Printout Of the $workloadTenant Objects" - -echo - -kubectl get -n $workloadTenant all - -echo namespace = $workloadTenant > $working_dir/workloadTenant_export - -## Make load test script in Jmeter master pod executable - -echo - -echo "Configuring load test settings in Master" - -sleep 10 - -#Get Master pod details - -master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` - -kubectl exec -ti -n $workloadTenant $master_pod -- cp -r /load_test /jmeter/load_test - -kubectl exec -ti -n $workloadTenant $master_pod -- chmod 755 /jmeter/load_test diff --git a/jmx/baseline.jmx b/jmx/baseline.jmx deleted file mode 100644 index 47254a1..0000000 --- a/jmx/baseline.jmx +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - {numUsers} - {ramp} - true - {duration} - - true - - - - 1 - {throughputPerMin} - - - - - - - google.com - 80 - http - - - GET - false - false - false - false - - 1000 - 1000 - - - - - - - influxdbMetricsSender - org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender - = - - - influxdbUrl - http://jmeter-influxdb.jmeter-monitoring:8086/write?db=jmeter - = - - - application - cloudssky - = - - - measurement - jmeter - = - - - summaryOnly - false - = - - - samplersRegex - .* - = - - - percentiles - 90;95;99 - = - - - testTitle - Test name - = - - - eventTags - - = - - - - org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient - - - - - - - \ No newline at end of file diff --git a/jmx/main.jmx b/jmx/main.jmx index 31471fe..b02043b 100644 --- a/jmx/main.jmx +++ b/jmx/main.jmx @@ -1,10 +1,10 @@ - + - + false - true + false @@ -12,81 +12,83 @@ - startnextloop + continue false -1 - ${__P(numUsers,5)} - ${__P(ramp,0)} + ${__P(numUsers,100)} + 1 + 1578521449000 + 1578521449000 true - ${__P(duration,90)} + ${__P(duration,600)} - true - - 1 - ${__P(throughputPerMin,300)} - - - + - ${__P(targetIP,20.41.60.31)} + ${__P(targetIP,52.167.17.34)} 80 - http + 1000 + 1000 + ${__P(path,/?marco)} GET false false - false + true false + HttpClient4 + false - 1000 - 1000 - - - false - - saveConfig - - - true - true - true - - true - true - true - false - false - false - false - true - false - false - true - false - false - true - true - 10 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - + + + 1 + ${__P(throughputPerMin,6000)} + + + + false + + saveConfig + + + true + true + true + + true + false + true + false + false + false + false + false + false + false + false + false + false + false + false + 0 + true + true + true + true + true + true + + + ${__P(outFile,/tmp/j.txt)} + + diff --git a/jmx/main2.jmx b/jmx/main2.jmx deleted file mode 100644 index 31471fe..0000000 --- a/jmx/main2.jmx +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - ${__P(numUsers,5)} - ${__P(ramp,0)} - true - ${__P(duration,90)} - - true - - - - 1 - ${__P(throughputPerMin,300)} - - - - - - - ${__P(targetIP,20.41.60.31)} - 80 - http - - ${__P(path,/?marco)} - GET - false - false - false - false - - 1000 - 1000 - - - - false - - saveConfig - - - true - true - true - - true - true - true - false - false - false - false - true - false - false - true - false - false - true - true - 10 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - - - - - diff --git a/jmx/main_std.jmx b/jmx/main_std.jmx deleted file mode 100644 index 05c9590..0000000 --- a/jmx/main_std.jmx +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - ${__P(numUsers,5)} - ${__P(ramp,0)} - true - ${__P(duration,90)} - - true - - - - 1 - ${__P(throughputPerMin,300)} - - - - - - - ${__P(targetIP,20.41.60.31)} - 80 - http - - ${__P(path,/?marco)} - GET - false - false - false - false - - 1000 - 1000 - - - - false - - saveConfig - - - true - true - true - - true - false - true - false - false - false - false - false - false - false - true - false - false - false - false - 0 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - - - - - diff --git a/jmx/parameterized.jmx b/jmx/parameterized.jmx deleted file mode 100644 index 05c9590..0000000 --- a/jmx/parameterized.jmx +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - ${__P(numUsers,5)} - ${__P(ramp,0)} - true - ${__P(duration,90)} - - true - - - - 1 - ${__P(throughputPerMin,300)} - - - - - - - ${__P(targetIP,20.41.60.31)} - 80 - http - - ${__P(path,/?marco)} - GET - false - false - false - false - - 1000 - 1000 - - - - false - - saveConfig - - - true - true - true - - true - false - true - false - false - false - false - false - false - false - true - false - false - false - false - 0 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - - - - - diff --git a/jmx/parameterizedramp.jmx b/jmx/parameterizedramp.jmx deleted file mode 100644 index dfbc8b8..0000000 --- a/jmx/parameterizedramp.jmx +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - ${__P(numUsers,5)} - ${__P(ramp,0)} - true - ${__P(duration,90)} - - true - - - - - - - ${__P(targetIP,20.41.60.31)} - 80 - http - - ${__P(path,/)} - GET - false - false - false - false - - 20000 - 20000 - - - - false - - saveConfig - - - true - true - true - - true - false - true - false - false - false - false - false - false - false - true - false - false - false - false - 0 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - - - - - 0 - ${__P(numUsers,5)} - ${__P(duration,60)} - - - - - - - - diff --git a/jmx/ramp.jmx b/jmx/ramp.jmx deleted file mode 100644 index 412e27a..0000000 --- a/jmx/ramp.jmx +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - ${__P(numUsers,5)} - ${__P(ramp,0)} - true - ${__P(duration,90)} - - true - - - - - - - ${__P(targetIP,20.41.60.31)} - 80 - http - - ${__P(path,/)} - GET - false - false - false - false - - 1000 - 1000 - - - - false - - saveConfig - - - true - true - true - - true - false - true - false - false - false - false - false - false - false - true - false - false - false - false - 0 - true - true - true - true - true - true - - - ${__P(outFile,C:\Users\gobibearAdmin\Desktop\results\resultsMultiVMs.csv)} - - - - - - - 0 - ${__P(numUsers,5)} - ${__P(duration,500)} - - - - - - - - diff --git a/jmx/standard-run.jmx b/jmx/standard-run.jmx deleted file mode 100644 index 8b5c8ae..0000000 --- a/jmx/standard-run.jmx +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - {numUsers} - {ramp} - true - {duration} - - true - - - - - - - google.com - 80 - http - - - GET - false - false - false - false - - 20000 - 20000 - - - - - - 0 - 500 - 60 - - - - - - - - - influxdbMetricsSender - org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender - = - - - influxdbUrl - http://jmeter-influxdb.jmeter-monitoring:8086/write?db=jmeter - = - - - application - cloudssky - = - - - measurement - jmeter - = - - - summaryOnly - false - = - - - samplersRegex - .* - = - - - percentiles - 90;95;99 - = - - - testTitle - Test name - = - - - eventTags - - = - - - - org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient - - - - - - diff --git a/jmx/testload-three.jmx b/jmx/testload-three.jmx deleted file mode 100644 index 169c45b..0000000 --- a/jmx/testload-three.jmx +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - 500 - 0 - true - 300 - - true - - - - - - - facebook.com - 80 - http - - - GET - false - false - false - false - - 20000 - 20000 - - - - - - 0 - 500 - 300 - - - - - - - - - influxdbMetricsSender - org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender - = - - - influxdbUrl - http://jmeter-influxdb.jmeter-monitoring:8086/write?db=jmeter - = - - - application - cloudssky - = - - - measurement - jmeter - = - - - summaryOnly - false - = - - - samplersRegex - .* - = - - - percentiles - 90;95;99 - = - - - testTitle - Test name - = - - - eventTags - - = - - - - org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient - - - - - - diff --git a/jmx/testload-two.jmx b/jmx/testload-two.jmx deleted file mode 100644 index d7a260f..0000000 --- a/jmx/testload-two.jmx +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - false - true - - - - - - - - startnextloop - - false - -1 - - 500 - 0 - true - 300 - - true - - - - - - - bing.com - 80 - http - - - GET - false - false - false - false - - 20000 - 20000 - - - - - - 0 - 500 - 300 - - - - - - - - - influxdbMetricsSender - org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender - = - - - influxdbUrl - http://jmeter-influxdb.jmeter-monitoring:8086/write?db=jmeter - = - - - application - cloudssky - = - - - measurement - jmeter - = - - - summaryOnly - false - = - - - samplersRegex - .* - = - - - percentiles - 90;95;99 - = - - - testTitle - Test name - = - - - eventTags - - = - - - - org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient - - - - - - diff --git a/k8sDefs/jmeter_grafana_deploy.yaml b/k8sDefs/jmeter_grafana_deploy.yaml deleted file mode 100644 index ca5867b..0000000 --- a/k8sDefs/jmeter_grafana_deploy.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: jmeter-grafana - labels: - app: jmeter-grafana -spec: - replicas: 1 - selector: - matchLabels: - app: jmeter-grafana - template: - metadata: - labels: - app: jmeter-grafana - spec: - containers: - - name: grafana - image: grafana/grafana:5.2.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 3000 - protocol: TCP - env: - - name: GF_AUTH_BASIC_ENABLED - value: "true" - - name: GF_USERS_ALLOW_ORG_CREATE - value: "true" - - name: GF_AUTH_ANONYMOUS_ENABLED - value: "true" - - name: GF_AUTH_ANONYMOUS_ORG_ROLE - value: Admin - - name: GF_SERVER_ROOT_URL - # If you're only using the API Server proxy, set this value instead: - # value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy - value: / diff --git a/k8sDefs/jmeter_grafana_svc.yaml b/k8sDefs/jmeter_grafana_svc.yaml deleted file mode 100644 index ff169c0..0000000 --- a/k8sDefs/jmeter_grafana_svc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: jmeter-grafana - labels: - app: jmeter-grafana -spec: - ports: - - port: 3000 - targetPort: 3000 - selector: - app: jmeter-grafana - type: NodePort \ No newline at end of file diff --git a/k8sDefs/jmeter_influxdb_configmap.yaml b/k8sDefs/jmeter_influxdb_configmap.yaml deleted file mode 100644 index 308a510..0000000 --- a/k8sDefs/jmeter_influxdb_configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: influxdb-config - labels: - app: influxdb-jmeter -data: - influxdb.conf: | - [meta] - dir = "/var/lib/influxdb/meta" - - [data] - dir = "/var/lib/influxdb/data" - engine = "tsm1" - wal-dir = "/var/lib/influxdb/wal" - - # Configure the graphite api - [[graphite]] - enabled = true - bind-address = ":2003" # If not set, is actually set to bind-address. - database = "jmeter" # store graphite data in this database \ No newline at end of file diff --git a/k8sDefs/jmeter_influxdb_deploy.yaml b/k8sDefs/jmeter_influxdb_deploy.yaml deleted file mode 100644 index 7e78408..0000000 --- a/k8sDefs/jmeter_influxdb_deploy.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: influxdb-jmeter - labels: - app: influxdb-jmeter -spec: - replicas: 1 - selector: - matchLabels: - app: influxdb-jmeter - template: - metadata: - labels: - app: influxdb-jmeter - spec: - containers: - - image: influxdb - imagePullPolicy: IfNotPresent - name: influxdb - volumeMounts: - - name: config-volume - mountPath: /etc/influxdb - ports: - - containerPort: 8083 - name: influx - - containerPort: 8086 - name: api - - containerPort: 2003 - name: graphite - volumes: - - name: config-volume - configMap: - name: influxdb-config \ No newline at end of file diff --git a/k8sDefs/jmeter_influxdb_svc.yaml b/k8sDefs/jmeter_influxdb_svc.yaml deleted file mode 100644 index 7147e6f..0000000 --- a/k8sDefs/jmeter_influxdb_svc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: jmeter-influxdb - labels: - app: influxdb-jmeter -spec: - ports: - - port: 8083 - name: http - targetPort: 8083 - - port: 8086 - name: api - targetPort: 8086 - - port: 2003 - name: graphite - targetPort: 2003 - selector: - app: influxdb-jmeter \ No newline at end of file diff --git a/k8sDefs/jmeter_master_deploy.yaml b/k8sDefs/jmeter_master_deploy.yaml index ec3f87d..b857698 100644 --- a/k8sDefs/jmeter_master_deploy.yaml +++ b/k8sDefs/jmeter_master_deploy.yaml @@ -19,23 +19,24 @@ spec: env: - name: 'JVM_ARGS' value: '-Xms756M -Xmx756M' - image: kubernautslabs/jmeter_master:latest + image: daweins/jmeterbase:v5 imagePullPolicy: IfNotPresent resources: requests: memory: "1024Mi" - cpu: "2000m" + cpu: "500m" limits: - memory: "1500Mi" - cpu: "4000m" + memory: "1024Mi" + cpu: "1000m" command: [ "/bin/bash", "-c", "--" ] args: [ "while [ ! -f /tmp/isdone ]; do sleep 30; done;" ] volumeMounts: - name: loadtest mountPath: /load_test subPath: "load_test" - - name: azure - mountPath: "/mnt/azure" + - name: azblob + mountPath: "/etc/azblob" + readOnly: true ports: - containerPort: 60000 restartPolicy: OnFailure @@ -43,8 +44,6 @@ spec: - name: loadtest configMap: name: jmeter-load-test - - name: azure - azureFile: # https://docs.microsoft.com/en-us/azure/aks/azure-files-volume - secretName: jmeterlogsecret - shareName: jmeterlogs - readOnly: false \ No newline at end of file + - name: azblob + secret: + secretName: azblob \ No newline at end of file diff --git a/k8sDefs/jmeter_master_svc.yaml b/k8sDefs/jmeter_master_svc.yaml new file mode 100644 index 0000000..78655d4 --- /dev/null +++ b/k8sDefs/jmeter_master_svc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: jmeter-master + labels: + app: jmeter-master +spec: + loadBalancerIP: 51.143.5.25 + type: LoadBalancer + ports: + - port: 80 + name: http + targetPort: 80 + selector: + app: jmeter-master \ No newline at end of file diff --git a/k8sDefs/jmeter_slaves_deploy.yaml b/k8sDefs/jmeter_slaves_deploy.yaml deleted file mode 100644 index b729f71..0000000 --- a/k8sDefs/jmeter_slaves_deploy.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: jmeter-slaves - labels: - jmeter_mode: slave -spec: - replicas: 1 - selector: - matchLabels: - jmeter_mode: slave - template: - metadata: - labels: - jmeter_mode: slave - spec: - containers: - - name: jmslave - image: kubernautslabs/jmeter_slave:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 1099 - - containerPort: 50000 diff --git a/k8sDefs/jmeter_slaves_svc.yaml b/k8sDefs/jmeter_slaves_svc.yaml deleted file mode 100644 index 94566f5..0000000 --- a/k8sDefs/jmeter_slaves_svc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: jmeter-slaves-svc - labels: - jmeter_mode: slave -spec: - clusterIP: None - ports: - - port: 1099 - name: first - targetPort: 1099 - - port: 50000 - name: second - targetPort: 50000 - selector: - jmeter_mode: slave \ No newline at end of file diff --git a/k8sDefs/kubeorchestrator.yaml b/k8sDefs/kubeorchestrator.yaml new file mode 100644 index 0000000..384b98d --- /dev/null +++ b/k8sDefs/kubeorchestrator.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 # for versions before 1.9.0 use apps/v1beta2 +kind: Pod +metadata: + name: kubeorchestrator +spec: + containers: + - name: orchestrator + image: daweins/korch:v1 + imagePullPolicy: IfNotPresent + command: [ "/bin/bash", "-c", "--" ] + args: [ "while [ ! -f /tmp/isdone ]; do git clone https://github.com/daweins/LaaS.git; cd LaaS; chmod 755 ./do_a_loop.sh; ./do_a_loop.sh; sleep 60; done;" ] + volumeMounts: + - mountPath: "/etc/azblob" + name: azblob + readOnly: true + volumes: + - name: azblob + secret: + secretName: azblob \ No newline at end of file diff --git a/k8sDefs/kubeorchestratoraccount.yaml b/k8sDefs/kubeorchestratoraccount.yaml new file mode 100644 index 0000000..072ee2e --- /dev/null +++ b/k8sDefs/kubeorchestratoraccount.yaml @@ -0,0 +1,13 @@ +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: overseer + namespace: orchestrator +subjects: +- kind: ServiceAccount + name: default + namespace: orchestrator +roleRef: + kind: ClusterRole + name: cluster-admin + apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/payload_script.sh b/payload_script.sh index d465989..e1dc5f6 100644 --- a/payload_script.sh +++ b/payload_script.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash - +jmeterPath='/apache-jmeter-5.2.1/bin/jmeter' +#jmeterPath='jmeter' +jmeterProps='-Dhttpclient4.time_to_live=1000000 -Jhttpclient4.time_to_live=1000000' targetIP=$1 displaytargetIP=`sed 's/\./_/g' <<< $targetIP` targetPath=$2 @@ -28,22 +30,28 @@ do curl $targetIP/$targetPath -o /mnt/azure/curl$curTimeString.txt else echo Starting JMeter - jMeterCmd="jmeter -n -t \"/tmp/main.jmx\" -JnumUsers=$numUsers -JtargetIP=\"$targetIP\" -JthroughputPerMin=$throughput -Jduration=$duration -JoutFile=\"$tmpDir$outFile\" -Jramp=$ramp -Jpath=\"$targetPath\"" - #jMeterCmd='cat parameterizedramp.jmx' + if [ $ramp -ne 0 ] + then + echo "Ramping" + jMeterCmd="$jmeterPath -n -t \"/tmp/main_ramp.jmx\" $jmeterProps -JnumUsers=$numUsers -JtargetIP=\"$targetIP\" -JthroughputPerMin=$throughput -Jduration=$duration -JoutFile=\"$tmpDir$outFile\" -Jramp=$ramp -Jpath=\"$targetPath\"" + else + jMeterCmd="$jmeterPath -n -t \"/tmp/main.jmx\" $jmeterProps -JnumUsers=$numUsers -JtargetIP=\"$targetIP\" -JthroughputPerMin=$throughput -Jduration=$duration -JoutFile=\"$tmpDir$outFile\" -Jramp=$ramp -Jpath=\"$targetPath\"" + fi echo $jMeterCmd - #$jMeterCmd eval $jMeterCmd fi done # Upload to storage -echo 10 second sleep -sleep 10 +echo 1 second sleep +sleep 1 echo Moving Output -mv $tmpDir*.csv $destDir*.csv - -echo Waiting to allow files to sync to Azure -sleep 60 +#mv $tmpDir*.csv $destDir +echo Copying to BLOB +blobToken=`cat /etc/azblob/azblobsas` +az storage blob upload-batch --account-name storannandale -s $tmpDir -d aksjmeter --pattern *.csv --sas-token $blobToken +echo Sleeping 30 minutes to delay next run +sleep 1800 echo Signal completion echo Complete >> /tmp/isdone diff --git a/start_full_test.sh b/start_full_test.sh deleted file mode 100755 index f99a236..0000000 --- a/start_full_test.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env bash -# Create multiple Jmeter namespaces on an existing kuberntes cluster -# Started On January 23, 2018 - -working_dir=`pwd` -integerCheck='^[0-9]+$' -jmxFile='jmx/baseline.jmx' -testRunConfig='test_runs/testRunConfig.txt' -jmxRunFile='temp/currentJmxRun.jmx' -jmxTextFile='temp/currentJmxText.txt' -index=0 - -echo "checking if kubectl is present" - -if ! hash kubectl 2>/dev/null -then - echo "'kubectl' was not found in PATH" - echo "Kindly ensure that you can acces an existing kubernetes cluster via kubectl" - exit -fi - -kubectl version --short - -echo "Current list of namespaces on the kubernetes cluster:" - -echo - -kubectl get namespaces | grep -v NAME | awk '{print $1}' - -echo - -echo "Enter the name of the new tenant unique name, this will be used to create the namespace" -read workloadTenant -echo - -# Check If namespace exists - -kubectl get namespace $workloadTenant > /dev/null 2>&1 - -if [ $? -eq 0 ] -then - echo "Namespace $workloadTenant already exists, please select a unique name" - echo "Current list of namespaces on the kubernetes cluster" - sleep 2 - - kubectl get namespaces | grep -v NAME | awk '{print $1}' - exit 1 -fi - -echo -echo "Creating Namespace: $workloadTenant" - -kubectl create namespace $workloadTenant - -echo "Namspace $workloadTenant has been created" - -echo - -echo "Creating Jmeter slave nodes" - -nodes=`kubectl get no | egrep -v "master|NAME" | wc -l` - -echo - -echo "Number of worker nodes on this cluster is " $nodes - -echo - -echo "Creating $nodes Jmeter slave replicas and service" - -echo - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_deploy.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_svc.yaml - -echo "Creating Jmeter Master" - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_configmap.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_deploy.yaml - -echo "Printout Of the $workloadTenant Objects" - -echo - -kubectl get -n $workloadTenant all - -echo namespace = $workloadTenant > $working_dir/workloadTenant_export - -## Make load test script in Jmeter master pod executable - -echo - -echo "Configuring load test settings in Master" - -sleep 30 - -# Get Master pod details - -master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` - -#kubectl exec -ti -n $workloadTenant $master_pod -- cp -r /load_test /jmeter/load_test - -#kubectl exec -ti -n $workloadTenant $master_pod -- chmod 755 /jmeter/load_test - -sed -n -e 'H;${x;s/\n/;;/g;s/^,//;p;}' $testRunConfig > $jmxTextFile -IFS=';;' read -ra configArray <<< $(cat $jmxTextFile) - -# Loop through each config and run JMeter set to that config -for newConfig in $configArray -do - # Remove whitespaces from string then convert to array - testRun="$(echo -e "${newConfig}" | tr -d '[:space:]')" - IFS=',' read -ra testArray <<< "$testRun" - - # Feed integer string into jmx file and run test - if ! [[ ${testArray[0]} =~ $integerCheck && ${testArray[1]} =~ $integerCheck && ${testArray[2]} =~ $integerCheck ]] - then - echo "Non-integer input detected. Skipping line." - else - # Script created to launch Jmeter tests directly from the current terminal without accessing the jmeter master pod. - # It requires that you supply the path to the jmx file - - ((throughputPerMin=${testArray[0]}*60)) - - sed "s/{numUsers}/${testArray[0]}/g;s/{duration}/${testArray[1]}/g;s/{ramp}/${testArray[2]}/g;s/{throughputPerMin}/$throughputPerMin/g" $jmxFile > $jmxRunFile - - test_name="$(basename "$jmxRunFile")" - - # Get Master pod details - - kubectl cp "$jmxRunFile" -n $workloadTenant "$master_pod:/$test_name" - - # Starting Jmeter load test - - kubectl exec -ti -n $workloadTenant $master_pod -- /bin/bash /load_test "$test_name" - fi -done - -# Delete jmeter test namespace when complete - -sleep 30 - -kubectl delete namespace $workloadTenant \ No newline at end of file diff --git a/start_jmeterPods.sh b/start_jmeterPods.sh deleted file mode 100755 index 2a69e14..0000000 --- a/start_jmeterPods.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -# Create multiple Jmeter namespaces on an existing kuberntes cluster -# Started On January 23, 2018 - -tenantName='aksjmeter' -working_dir=`pwd` -integerCheck='^[0-9]+$' -jmxFile='jmx/baseline.jmx' -testRunConfig='test_runs/testRunConfig.txt' -jmxRunFile='temp/currentJmxRun.jmx' -jmxTextFile='temp/currentJmxText.txt' -index=0 - -echo "checking if kubectl is present" - -if ! hash kubectl 2>/dev/null -then - echo "'kubectl' was not found in PATH" - echo "Kindly ensure that you can acces an existing kubernetes cluster via kubectl" - exit -fi - -kubectl version --short - -echo "Current list of namespaces on the kubernetes cluster:" - -echo - -kubectl get namespaces | grep -v NAME | awk '{print $1}' - -echo -# -echo "Enter the name of the new tenant unique name, this will be used to create the namespace" -workloadTenant=$tenantName -echo $workloadTenant - -# Check If namespace exists - -kubectl get namespace $workloadTenant > /dev/null 2>&1 - -if [ $? -eq 0 ] -then - echo "Namespace $workloadTenant already exists, please select a unique name" - echo "Current list of namespaces on the kubernetes cluster" - sleep 2 - - kubectl get namespaces | grep -v NAME | awk '{print $1}' - exit 1 -fi - -echo -echo "Creating Namespace: $workloadTenant" - -kubectl create namespace $workloadTenant - -echo "Namspace $workloadTenant has been created" - -echo - -echo "Creating Jmeter slave nodes" - -nodes=`kubectl get no | egrep -v "master|NAME" | wc -l` - -echo - -echo "Number of worker nodes on this cluster is " $nodes - -echo - -echo "Creating $nodes Jmeter slave replicas and service" - -echo - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_deploy.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_slaves_svc.yaml - -echo "Creating Jmeter Master" - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_configmap.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_deploy.yaml - -echo "Printout Of the $workloadTenant Objects" - -echo - -kubectl get -n $workloadTenant all - -echo namespace = $workloadTenant > $working_dir/workloadTenant_export - -## Make load test script in Jmeter master pod executable - -echo - -echo "Configuring load test settings in Master (sleeping for 30sec)" - -sleep 30 - -# Get Master pod details - -master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` \ No newline at end of file diff --git a/start_test.sh b/start_test.sh deleted file mode 100755 index 834a23f..0000000 --- a/start_test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -#Script created to launch Jmeter tests directly from the current terminal without accessing the jmeter master pod. -#It requires that you supply the path to the jmx file -#After execution, test script jmx file may be deleted from the pod itself but not locally. - -working_dir="`pwd`" - -#Get namesapce variable -workloadTenant=`awk '{print $NF}' "$working_dir/workloadTenant_export"` - -jmx="$1" -[ -n "$jmx" ] || read -p 'Enter path to the jmx file to run ' jmx - -if [ ! -f "$jmx" ]; -then - echo "Test script file was not found in PATH" - echo "Kindly check and input the correct file path" - exit -fi - -test_name="$(basename "$jmx")" - -echo $test_name - -#Get Master pod details - -master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` - -kubectl cp "$jmx" -n $workloadTenant "$master_pod:/$test_name" - -## Echo Starting Jmeter load test - -kubectl exec -ti -n $workloadTenant $master_pod -- /bin/bash /load_test "$test_name" diff --git a/start_testLoop.sh b/start_testLoop.sh index e3135f7..1d0fdc9 100755 --- a/start_testLoop.sh +++ b/start_testLoop.sh @@ -4,7 +4,7 @@ # Debug Settings doBlobUpdate=0 # 0 = disable doK8s=1 # 0 = disable -doParallelRuns=0 #0= disable +doParallelRuns=1 #0= disable integerCheck='^[0-9]+$' @@ -16,6 +16,8 @@ testMasterName='currentTests.csv' jmxFile='jmx/main.jmx' jmxDestFile='/tmp/main.jmx' +jmxRampFile='jmx/main_ramp.jmx' +jmxRampDestFile='/tmp/main_ramp.jmx' payloadScript="payload_script.sh" payloadDestFile="/tmp/payload_script.sh" @@ -125,7 +127,7 @@ do # Check if job is currently running kubectl -n $workloadTenant get pods podStatus=`kubectl -n $workloadTenant get pods` - if [[ $podStatus == *Running* ]] + if [[ $podStatus == *Running* || $podStatus == *Image* ]] then echo Job is still running in $workloadTenant else @@ -137,7 +139,7 @@ do kubectl create namespace $workloadTenant echo Cloning Secret # TODO - Talk to Al if this is reasonable. Note assumption that there is a secret to clone from. Al says I can do this with permissions across namespaces - kubectl get secret jmeterlogsecret -o yaml | sed s/"namespace: default"/"namespace: $workloadTenant"/ | kubectl apply -n $workloadTenant -f - + kubectl get secret azblob -o yaml | sed s/"namespace: default"/"namespace: $workloadTenant"/ | kubectl apply -n $workloadTenant -f - # Create Master pod details echo "Creating Jmeter Master" @@ -154,6 +156,7 @@ do echo Copying payload to master pod # Copy the jmx template to the pod kubectl cp "$jmxFile" -n $workloadTenant "$master_pod:/$jmxDestFile" + kubectl cp "$jmxRampFile" -n $workloadTenant "$master_pod:/$jmxRampDestFile" # Copy the script to the pod kubectl cp "$payloadScript" -n $workloadTenant "$master_pod:/$payloadDestFile" @@ -163,9 +166,9 @@ do # TODO - Talk to Al about this - should probably be done in the image. Al agrees - - kubectl exec -i -n $workloadTenant $master_pod -- apt-get update - kubectl exec -i -n $workloadTenant $master_pod -- apt install curl -y --fix-missing + # Moved to the image + #kubectl exec -i -n $workloadTenant $master_pod -- apt-get update + #kubectl exec -i -n $workloadTenant $master_pod -- apt install curl -y --fix-missing # Not needed - using Azure Files to upload rather than blob kubectl exec -i -n $workloadTenant $master_pod -- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # run the script diff --git a/temp/testDefs/5minutepause.txt b/temp/testDefs/5minutepause.txt deleted file mode 100644 index 5cb0faa..0000000 --- a/temp/testDefs/5minutepause.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -100,300,0 \ No newline at end of file diff --git a/temp/testDefs/annandaleignite.txt b/temp/testDefs/annandaleignite.txt deleted file mode 100644 index c0aa144..0000000 --- a/temp/testDefs/annandaleignite.txt +++ /dev/null @@ -1,5 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -2,180,0 -300,180,180 -300,600,0 -1,900,0 diff --git a/temp/testDefs/annandaleignitelong.txt b/temp/testDefs/annandaleignitelong.txt deleted file mode 100644 index 6fc128e..0000000 --- a/temp/testDefs/annandaleignitelong.txt +++ /dev/null @@ -1,3 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -300,600,0 - diff --git a/temp/testDefs/awsTest.txt b/temp/testDefs/awsTest.txt deleted file mode 100644 index da2ebeb..0000000 --- a/temp/testDefs/awsTest.txt +++ /dev/null @@ -1,12 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -60,185,0 -120,180,0 -60,185,0 -120,180,0 -60,185,0 -120,180,0 -60,185,0 -120,180,0 -60,185,0 -120,180,0 -60,185,0 \ No newline at end of file diff --git a/temp/testDefs/currentTests.csv b/temp/testDefs/currentTests.csv index ba3862d..86d45bb 100644 --- a/temp/testDefs/currentTests.csv +++ b/temp/testDefs/currentTests.csv @@ -1,13 +1,12 @@ CurTest, Enabled, CurEndPoint,Path, CurTestName -bing,FALSE,www.bing.com,,testlimit.txt -azcatsynthappbaseline,FALSE,52.138.116.190,?marco,jediprod.txt -azcatsynthappbaseline,FALSE,52.138.116.190,?marco,steady.txt -azcatsynthappbaseline,FALSE,52.138.116.190,?marco,testlimit.txt -azcatsynthappnocrasha,FALSE,52.167.17.34,?marco,testlimitlow.txt -azcatsynthappnocrashb,FALSE,52.167.17.34,?marco,testlimitlow.txt -azcatsynthappnocrashc,FALSE,52.167.17.34,?marco,testlimitlow.txt -azcatsynthappnocrashd,FALSE,52.167.17.34,?marco,steady.txt -helloworld,TRUE,azcathelloworld.azurewebsites.net,?marco,steady.txt +bing,TRUE,www.bing.com,,shortest.txt +azcatsynthappnocrash,FALSE,52.167.17.34,?marco,jediprod.txt +azcatsynthappbaseline,TRUE,52.138.116.190,?marco,jediprod.txt +helloworld,FALSE,azcathelloworld.azurewebsites.net,bob,jediprod.txt +azcatsynthappnocrashminimal,FALSE,52.167.17.34,?marco,minimaltest.txt +azcatsynthappbaselineminimal,FALSE,52.138.116.190,?marco,minimaltest.txt +cnn,TRUE,www.cnn.com,,testlimit.txt + diff --git a/temp/testDefs/eastus1-dynamo.txt b/temp/testDefs/eastus1-dynamo.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus1-dynamo.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/eastus1-peek.txt b/temp/testDefs/eastus1-peek.txt deleted file mode 100644 index 50272af..0000000 --- a/temp/testDefs/eastus1-peek.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -500,300,0 \ No newline at end of file diff --git a/temp/testDefs/eastus1-rds.txt b/temp/testDefs/eastus1-rds.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus1-rds.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/eastus1-s3.txt b/temp/testDefs/eastus1-s3.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus1-s3.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/eastus2-dynamo.txt b/temp/testDefs/eastus2-dynamo.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus2-dynamo.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/eastus2-peek.txt b/temp/testDefs/eastus2-peek.txt deleted file mode 100644 index 50272af..0000000 --- a/temp/testDefs/eastus2-peek.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -500,300,0 \ No newline at end of file diff --git a/temp/testDefs/eastus2-rds.txt b/temp/testDefs/eastus2-rds.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus2-rds.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/eastus2-s3.txt b/temp/testDefs/eastus2-s3.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/eastus2-s3.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/flatLoad.txt b/temp/testDefs/flatLoad.txt deleted file mode 100644 index 057fa03..0000000 --- a/temp/testDefs/flatLoad.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -1,86400,0 \ No newline at end of file diff --git a/temp/testDefs/jedi_short.txt b/temp/testDefs/jedi_short.txt deleted file mode 100644 index 281f64e..0000000 --- a/temp/testDefs/jedi_short.txt +++ /dev/null @@ -1,8 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -150,60,60 -1,45,0 -450,75,75 -1,45,0 -50,60,0 - - diff --git a/temp/testDefs/jedilikeaws.txt b/temp/testDefs/jedilikeaws.txt deleted file mode 100644 index 01b6dfb..0000000 --- a/temp/testDefs/jedilikeaws.txt +++ /dev/null @@ -1,6 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -150,120,120 -150,180,0 -450,120,120 -450,300,0 -60,360,0 diff --git a/temp/testDefs/minimaltest.txt b/temp/testDefs/minimaltest.txt deleted file mode 100644 index 6500aec..0000000 --- a/temp/testDefs/minimaltest.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -600,15,15 \ No newline at end of file diff --git a/temp/testDefs/ramptest.txt b/temp/testDefs/ramptest.txt deleted file mode 100644 index 0146cd3..0000000 --- a/temp/testDefs/ramptest.txt +++ /dev/null @@ -1,6 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -100,120,120 -100,180,180 -200,120,120 -300,240,240 - diff --git a/temp/testDefs/1minutepause.txt b/temp/testDefs/shortest.txt similarity index 80% rename from temp/testDefs/1minutepause.txt rename to temp/testDefs/shortest.txt index a1f904e..e497957 100644 --- a/temp/testDefs/1minutepause.txt +++ b/temp/testDefs/shortest.txt @@ -1,2 +1,2 @@ -NumUsers, DurationSeconds, RampSeconds -100,60,0 \ No newline at end of file +NumUsers, DurationSeconds, RampSeconds +100,120,0 \ No newline at end of file diff --git a/temp/testDefs/singlepoke.txt b/temp/testDefs/singlepoke.txt deleted file mode 100644 index e8f23b4..0000000 --- a/temp/testDefs/singlepoke.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/steady.txt b/temp/testDefs/steady.txt deleted file mode 100644 index 61a03e8..0000000 --- a/temp/testDefs/steady.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -10,1800,1 \ No newline at end of file diff --git a/temp/testDefs/testlimit.txt b/temp/testDefs/testlimit.txt index 686b48f..736a35d 100644 --- a/temp/testDefs/testlimit.txt +++ b/temp/testDefs/testlimit.txt @@ -1,42 +1,3 @@ NumUsers, DurationSeconds, RampSeconds 100,120,0 -100,120,0 -200,120,0 -200,120,0 -300,120,0 -300,120,0 -400,120,0 -400,120,0 -500,120,0 -500,120,0 -600,120,0 -600,120,0 -700,120,0 -700,120,0 -800,120,0 -800,120,0 -900,120,0 -900,120,0 -1000,120,0 -1000,120,0 -1100,120,0 -1100,120,0 -1200,120,0 -1200,120,0 -1300,120,0 -1300,120,0 -1400,120,0 -1400,120,0 -1500,120,0 -1500,120,0 -1600,120,0 -1600,120,0 -1700,120,0 -1700,120,0 -1800,120,0 -1800,120,0 -1900,120,0 -1900,120,0 -2000,120,0 -2000,120,0 - +600,300,300 \ No newline at end of file diff --git a/temp/testDefs/testlimitlow.txt b/temp/testDefs/testlimitlow.txt deleted file mode 100644 index 2e1ba59..0000000 --- a/temp/testDefs/testlimitlow.txt +++ /dev/null @@ -1,14 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -1,60,0 -2,60,0 -3,60,0 -4,60,0 -5,60,0 -6,60,0 -7,60,0 -8,60,0 -9,60,0 -10,60,0 -50,60,0 -100,60,0 -200,60,0 \ No newline at end of file diff --git a/temp/testDefs/westus1-dynamo.txt b/temp/testDefs/westus1-dynamo.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus1-dynamo.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/westus1-peek.txt b/temp/testDefs/westus1-peek.txt deleted file mode 100644 index 50272af..0000000 --- a/temp/testDefs/westus1-peek.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -500,300,0 \ No newline at end of file diff --git a/temp/testDefs/westus1-rds.txt b/temp/testDefs/westus1-rds.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus1-rds.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/westus1-s3.txt b/temp/testDefs/westus1-s3.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus1-s3.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/westus2-dynamo.txt b/temp/testDefs/westus2-dynamo.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus2-dynamo.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/westus2-peek.txt b/temp/testDefs/westus2-peek.txt deleted file mode 100644 index 50272af..0000000 --- a/temp/testDefs/westus2-peek.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -500,300,0 \ No newline at end of file diff --git a/temp/testDefs/westus2-rds.txt b/temp/testDefs/westus2-rds.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus2-rds.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/temp/testDefs/westus2-s3.txt b/temp/testDefs/westus2-s3.txt deleted file mode 100644 index 459daf0..0000000 --- a/temp/testDefs/westus2-s3.txt +++ /dev/null @@ -1,2 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -0,0,0 \ No newline at end of file diff --git a/test_manual.sh b/test_manual.sh deleted file mode 100755 index 048090c..0000000 --- a/test_manual.sh +++ /dev/null @@ -1,31 +0,0 @@ -workloadTenant="manual" - -jmxFile='jmx/main.jmx' -jmxDestFile='/tmp/main.jmx' - -payloadScript="payload_script.sh" -payloadDestFile="/tmp/payload_script.sh" - -working_dir='k8sDefs' -echo "Namspace $workloadTenant deleting" -kubectl delete namespace $workloadTenant - -echo "Namspace $workloadTenant creating" -kubectl create namespace $workloadTenant -kubectl get secret jmeterlogsecret -o yaml | sed s/"namespace: default"/"namespace: $workloadTenant"/ | kubectl apply -n $workloadTenant -f - -echo "Creating Jmeter Master" -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_configmap.yaml - -kubectl create -n $workloadTenant -f $working_dir/jmeter_master_deploy.yaml - -#TODO - make this check on the status of master instead of arbitrary... -echo Waiting for master pod to be ready -sleep 60 -master_pod=`kubectl get po -n $workloadTenant | grep jmeter-master | awk '{print $1}'` - -echo Copying payload to master pod -# Copy the jmx template to the pod -kubectl cp "$jmxFile" -n $workloadTenant "$master_pod:/$jmxDestFile" - -# Copy the script to the pod -kubectl cp "$payloadScript" -n $workloadTenant "$master_pod:/$payloadDestFile" diff --git a/test_runs/testRunConfig.txt b/test_runs/testRunConfig.txt deleted file mode 100644 index 635053c..0000000 --- a/test_runs/testRunConfig.txt +++ /dev/null @@ -1,3 +0,0 @@ -NumUsers, DurationSeconds, RampSeconds -60,300,0 -500,300,0 diff --git a/testrun.sh b/testrun.sh deleted file mode 100755 index 5f123db..0000000 --- a/testrun.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# Create multiple Jmeter namespaces on an existing kuberntes cluster -# Started On January 23, 2018 - -working_dir=`pwd` -integerCheck='^[0-9]+$' -jmxFile='jmx/baseline.jmx' -testRunConfig='test_runs/testRunConfig.txt' -jmxRunFile='temp/currentJmxRun.jmx' -jmxTextFile='temp/currentJmxText.txt' -index=0 - -sed -n -e 'H;${x;s/\n/;;/g;s/^,//;p;}' $testRunConfig > $jmxTextFile -IFS=';;' read -ra configArray <<< $(cat $jmxTextFile) - -# Loop through each config and run JMeter set to that config -for newConfig in $configArray -do - # Remove whitespaces from string then convert to array - testRun="$(echo -e "${newConfig}" | tr -d '[:space:]')" - echo $testRun - IFS=',' read -ra testArray <<< "$testRun" - - # Feed integer string into jmx file and run test - if ! [[ ${testArray[0]} =~ $integerCheck && ${testArray[1]} =~ $integerCheck && ${testArray[2]} =~ $integerCheck ]] - then - echo "Non-integer input detected. Skipping line." - else - # Script created to launch Jmeter tests directly from the current terminal without accessing the jmeter master pod. - # It requires that you supply the path to the jmx file - - echo "Loop output" - echo ${testArray[0]} - echo ${testArray[1]} - echo ${testArray[2]} - - fi -done - -# Delete jmeter test namespace when complete diff --git a/workloadTenant_export b/workloadTenant_export deleted file mode 100644 index c2d14d8..0000000 --- a/workloadTenant_export +++ /dev/null @@ -1 +0,0 @@ -namespace = aksjmeter