{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "Prometheus datasource scraping loadr",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "title": "loadr — live load test",
  "tags": ["loadr", "load-testing"],
  "schemaVersion": 39,
  "editable": true,
  "time": { "from": "now-15m", "to": "now" },
  "refresh": "5s",
  "panels": [
    {
      "id": 1,
      "title": "Requests / sec",
      "type": "timeseries",
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
      "targets": [
        { "refId": "A", "expr": "sum(rate(loadr_http_reqs_total[1m]))", "legendFormat": "req/s" }
      ]
    },
    {
      "id": 2,
      "title": "Avg request duration (ms)",
      "type": "timeseries",
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
      "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(rate(loadr_http_req_duration_milliseconds_sum[1m])) / sum(rate(loadr_http_req_duration_milliseconds_count[1m]))",
          "legendFormat": "avg ms"
        }
      ]
    },
    {
      "id": 3,
      "title": "Active VUs",
      "type": "timeseries",
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
      "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
      "targets": [
        { "refId": "A", "expr": "sum(loadr_vus)", "legendFormat": "vus" }
      ]
    },
    {
      "id": 4,
      "title": "Check pass rate",
      "type": "stat",
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
      "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
      "fieldConfig": { "defaults": { "unit": "percentunit", "min": 0, "max": 1 }, "overrides": [] },
      "targets": [
        { "refId": "A", "expr": "avg(loadr_checks_rate)", "legendFormat": "checks" }
      ]
    }
  ]
}
