Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: 'myinfluxdb'
|
||||
orgId: 1
|
||||
folder: ''
|
||||
type: file
|
||||
disableDeletion: false
|
||||
editable: true
|
||||
options:
|
||||
path: /etc/grafana/provisioning/dashboards
|
||||
@@ -0,0 +1,444 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": null,
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 5,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"rightSide": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.3.6",
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
"1s"
|
||||
],
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"scenario"
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"status"
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"null"
|
||||
],
|
||||
"type": "fill"
|
||||
}
|
||||
],
|
||||
"measurement": "http_reqs",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"refId": "A",
|
||||
"resultFormat": "time_series",
|
||||
"select": [
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"value"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
{
|
||||
"params": [],
|
||||
"type": "count"
|
||||
}
|
||||
]
|
||||
],
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Requests",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"$$hashKey": "object:671",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"$$hashKey": "object:672",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": true,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "myinfluxdb",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {},
|
||||
"links": []
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 7,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 8
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"rightSide": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.3.6",
|
||||
"pointradius": 1,
|
||||
"points": true,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": true,
|
||||
"targets": [
|
||||
{
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
"1s"
|
||||
],
|
||||
"type": "time"
|
||||
}
|
||||
],
|
||||
"measurement": "http_req_duration",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"query": "SELECT mean(\"value\") FROM \"http_req_duration\" WHERE $timeFilter GROUP BY time($__interval) fill(null)",
|
||||
"rawQuery": false,
|
||||
"refId": "A",
|
||||
"resultFormat": "time_series",
|
||||
"select": [
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"value"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
{
|
||||
"params": [],
|
||||
"type": "mean"
|
||||
}
|
||||
]
|
||||
],
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "http-req duration",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"$$hashKey": "object:543",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"$$hashKey": "object:544",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": true,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "myinfluxdb",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {},
|
||||
"links": []
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 3,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 15
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 3,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.3.6",
|
||||
"pointradius": 1,
|
||||
"points": true,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
"1s"
|
||||
],
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"null"
|
||||
],
|
||||
"type": "fill"
|
||||
}
|
||||
],
|
||||
"measurement": "vus",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"query": "SELECT mean(\"value\") FROM \"http_req_duration\" WHERE $timeFilter GROUP BY time($__interval) fill(null)",
|
||||
"rawQuery": false,
|
||||
"refId": "A",
|
||||
"resultFormat": "time_series",
|
||||
"select": [
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"value"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
{
|
||||
"params": [],
|
||||
"type": "mean"
|
||||
}
|
||||
]
|
||||
],
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "vus",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"$$hashKey": "object:309",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"$$hashKey": "object:310",
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"refresh": false,
|
||||
"schemaVersion": 26,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-30m",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": [
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
]
|
||||
},
|
||||
"timezone": "",
|
||||
"title": "k6 performance test",
|
||||
"uid": "Le2Ku9NMk",
|
||||
"version": 1
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: myinfluxdb
|
||||
type: influxdb
|
||||
access: proxy
|
||||
database: k6
|
||||
orgId: 1
|
||||
url: http://influxdb:8086
|
||||
isDefault: true
|
||||
@@ -0,0 +1,73 @@
|
||||
import http from 'k6/http';
|
||||
import { sleep } from 'k6';
|
||||
|
||||
export let options = {
|
||||
scenarios: {
|
||||
normal: {
|
||||
executor: 'constant-vus',
|
||||
vus: 200,
|
||||
duration: '10s',
|
||||
exec: "normal",
|
||||
gracefulStop: '0s',
|
||||
},
|
||||
notFound: {
|
||||
executor: 'constant-vus',
|
||||
vus: 200,
|
||||
duration: '10s',
|
||||
exec: "notFound",
|
||||
gracefulStop: '0s',
|
||||
startTime: '10s'
|
||||
},
|
||||
error: {
|
||||
executor: 'constant-vus',
|
||||
vus: 200,
|
||||
duration: '10s',
|
||||
exec: "error",
|
||||
gracefulStop: '0s',
|
||||
startTime: '20s'
|
||||
},
|
||||
slow: {
|
||||
executor: 'constant-vus',
|
||||
vus: 200,
|
||||
duration: '10s',
|
||||
exec: "slow",
|
||||
gracefulStop: '10s',
|
||||
startTime: '30s'
|
||||
},
|
||||
verySlow: {
|
||||
executor: 'constant-vus',
|
||||
vus: 200,
|
||||
duration: '10s',
|
||||
exec: "verySlow",
|
||||
gracefulStop: '30s',
|
||||
startTime: '50s'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const host = "http://host.docker.internal:5000";
|
||||
|
||||
export function normal() {
|
||||
http.get(host + "/product/1/similar");
|
||||
sleep(0.5);
|
||||
}
|
||||
|
||||
export function slow() {
|
||||
http.get(host + "/product/2/similar");
|
||||
sleep(0.5);
|
||||
}
|
||||
|
||||
export function verySlow() {
|
||||
http.get(host + "/product/3/similar");
|
||||
sleep(0.5);
|
||||
}
|
||||
|
||||
export function notFound() {
|
||||
http.get(host + "/product/4/similar");
|
||||
sleep(0.5);
|
||||
}
|
||||
|
||||
export function error() {
|
||||
http.get(host + "/product/5/similar");
|
||||
sleep(0.5);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"path": "/product/1/similarids",
|
||||
"body": "[2,3,4]",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/2/similarids",
|
||||
"body": "[3,100,1000]",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/3/similarids",
|
||||
"body": "[100,1000,10000]",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/4/similarids",
|
||||
"body": "[1,2,5]",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/5/similarids",
|
||||
"body": "[1,2,6]",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/1",
|
||||
"body": "{\"id\":\"1\",\"name\":\"Shirt\",\"price\":9.99,\"availability\":true}",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/2",
|
||||
"body": "{\"id\":\"2\",\"name\":\"Dress\",\"price\":19.99,\"availability\":true}",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/3",
|
||||
"body": "{\"id\":\"3\",\"name\":\"Blazer\",\"price\":29.99,\"availability\":false}",
|
||||
"headers": {"Content-Type": "application/json"},
|
||||
"delay": 100
|
||||
},
|
||||
{
|
||||
"path": "/product/4",
|
||||
"body": "{\"id\":\"4\",\"name\":\"Boots\",\"price\":39.99,\"availability\":true}",
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/5",
|
||||
"body": "{\"message\":\"Product not found\"}",
|
||||
"status": 404,
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/6",
|
||||
"status": 500,
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/100",
|
||||
"body": "{\"id\":\"100\",\"name\":\"Trousers\",\"price\":49.99,\"availability\":false}",
|
||||
"delay": 1000,
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/1000",
|
||||
"body": "{\"id\":\"1000\",\"name\":\"Coat\",\"price\":89.99,\"availability\":true}",
|
||||
"delay": 5000,
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
},
|
||||
{
|
||||
"path": "/product/10000",
|
||||
"body": "{\"id\":\"10000\",\"name\":\"Leather jacket\",\"price\":89.99,\"availability\":true}",
|
||||
"delay": 50000,
|
||||
"headers": {"Content-Type": "application/json"}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user