Skip to content

Instantly share code, notes, and snippets.

@egor-romanov
Last active February 15, 2024 14:07
Show Gist options
  • Save egor-romanov/df6b61f5b0ac3a6f4afdbb19154a612f to your computer and use it in GitHub Desktop.
Save egor-romanov/df6b61f5b0ac3a6f4afdbb19154a612f to your computer and use it in GitHub Desktop.
Grafana dashboard for navigating through the history of performance benchmarks
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 15,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"links": [
{
"targetBlank": true,
"title": "go to this time range",
"url": "<ENTER_LINK_TO_YOUR_BENCHMARK_DASHBOARD>?orgId=1&from=${__data.fields[\"started\"]}&to=${__data.fields[\"finished\"]}&var-testrun=${__data.fields[\"testrun\"]}"
}
],
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Metric"
},
"properties": [
{
"id": "custom.width",
"value": 588
}
]
},
{
"matcher": {
"id": "byName",
"options": "Field"
},
"properties": [
{
"id": "custom.width",
"value": 231
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 0
},
"hideTimeOverride": true,
"id": 2,
"interval": "1s",
"maxDataPoints": 40000,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "10.4.0-66955",
"targets": [
{
"datasource": {
"type": "prometheus"
},
"editorMode": "code",
"expr": "group by(testrun) (k6_data_sent_counter{scenario=\"$scenario\"})",
"hide": false,
"range": true,
"refId": "A"
}
],
"title": "Test run time range",
"transformations": [
{
"id": "seriesToRows",
"options": {}
},
{
"id": "calculateField",
"options": {
"alias": "Timestamp",
"mode": "reduceRow",
"reduce": {
"include": [
"Time"
],
"reducer": "sum"
},
"replaceFields": false
}
},
{
"id": "groupBy",
"options": {
"fields": {
"Metric": {
"aggregations": [],
"operation": "groupby"
},
"Timestamp": {
"aggregations": [
"min",
"max"
],
"operation": "aggregate"
},
"Total": {
"aggregations": [
"min",
"max"
],
"operation": "aggregate"
}
}
}
},
{
"id": "calculateField",
"options": {
"alias": "started",
"binary": {
"left": "Timestamp (min)",
"operator": "-",
"reducer": "sum",
"right": "300000"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
}
}
},
{
"id": "calculateField",
"options": {
"alias": "finished",
"binary": {
"left": "Timestamp (max)",
"reducer": "sum",
"right": "5000"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
}
}
},
{
"id": "convertFieldType",
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "Timestamp (min)"
},
{
"destinationType": "time",
"targetField": "Timestamp (max)"
}
],
"fields": {}
}
},
{
"id": "extractFields",
"options": {
"source": "Metric"
}
},
{
"id": "organize",
"options": {
"excludeByName": {
"(k6_vus_gauge)": true,
"Metric": true,
"by(testrun)": true,
"group": true
},
"indexByName": {
"Metric": 0,
"Timestamp (max)": 3,
"Timestamp (min)": 2,
"finished": 5,
"started": 4,
"testrun": 1
},
"renameByName": {}
}
},
{
"id": "sortBy",
"options": {
"fields": {},
"sort": [
{
"desc": true,
"field": "finished"
}
]
}
}
],
"transparent": true,
"type": "table"
},
{
"datasource": {
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 500
},
{
"color": "dark-red",
"value": 1000
}
]
},
"unit": "ms"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 9
},
"id": 4,
"maxDataPoints": 30000,
"options": {
"displayMode": "lcd",
"maxVizHeight": 300,
"minVizHeight": 10,
"minVizWidth": 0,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [],
"fields": "",
"limit": 20,
"values": true
},
"showUnfilled": true,
"sizing": "auto",
"valueMode": "color"
},
"pluginVersion": "10.4.0-66955",
"targets": [
{
"datasource": {
"type": "prometheus"
},
"editorMode": "code",
"expr": "quantile_over_time(0.95, k6_latency_trend_current_gauge{scenario=\"$scenario\"}[$__range:10s])",
"hide": false,
"legendFormat": "{{testrun}}",
"range": true,
"refId": "A"
}
],
"title": "Latency p95",
"transformations": [
{
"id": "seriesToRows",
"options": {}
},
{
"id": "groupBy",
"options": {
"fields": {
"Metric": {
"aggregations": [],
"operation": "groupby"
},
"Time": {
"aggregations": [
"mean"
],
"operation": "aggregate"
},
"Value": {
"aggregations": [
"max"
],
"operation": "aggregate"
}
}
}
},
{
"id": "sortBy",
"options": {
"fields": {},
"sort": [
{
"desc": true,
"field": "Time (mean)"
}
]
}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time (mean)": true
},
"indexByName": {},
"renameByName": {}
}
}
],
"transparent": true,
"type": "bargauge"
}
],
"refresh": "1m",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "prometheus"
},
"definition": "label_values(k6_iterations_counter,scenario)",
"hide": 0,
"includeAll": true,
"label": "",
"multi": true,
"name": "scenario",
"options": [],
"query": {
"query": "label_values(k6_iterations_counter,scenario)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-42d",
"to": "now-28d"
},
"timepicker": {},
"timezone": "",
"title": "Realtime Benchmarks Runs",
"version": 22,
"weekStart": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment