{
  "name": "Sürüm karşılaştırma: test ve dev",
  "variables": { "base": "https://test.shop.example.com" },
  "environments": {
    "test": {
      "variables": { "base": "https://test.shop.example.com" },
      "declared": { "cpu": "4 vCPU", "memory": "8 GiB", "instances": 3, "dbVersion": "PostgreSQL 16.4", "dataVolume": "2 milyon ürün", "cache": "sıcak" },
      "version": { "url": "{{base}}/version", "from": "jsonpath", "expr": "$.version" }
    },
    "dev": {
      "variables": { "base": "https://dev.shop.example.com" },
      "declared": { "cpu": "4 vCPU", "memory": "8 GiB", "instances": 3, "dbVersion": "PostgreSQL 16.4", "dataVolume": "2 milyon ürün", "cache": "sıcak" },
      "version": { "url": "{{base}}/version", "from": "jsonpath", "expr": "$.version" }
    }
  },
  "options": { "timeout": "10s", "gracefulStop": "30s" },
  "scenarios": [
    {
      "name": "gezinme",
      "executor": { "type": "ramping-vus", "startVUs": 0,
        "stages": [ { "duration": "1m", "target": 100 }, { "duration": "8m", "target": 100 }, { "duration": "30s", "target": 0 } ] },
      "steps": [
        { "id": "products", "name": "Ürün listesi",
          "request": { "url": "{{base}}/api/products", "query": [ { "key": "page", "value": "{{$randInt 1 20}}" } ] },
          "extract": [ { "var": "productId", "from": "jsonpath", "expr": "$.items[0].id" } ],
          "checks": [ { "type": "status", "value": 200 } ],
          "thinkTime": { "min": "1s", "max": "3s" } },
        { "id": "product", "name": "Ürün detayı",
          "request": { "url": "{{base}}/api/products/{{productId}}" },
          "checks": [ { "type": "status", "value": 200 } ],
          "thinkTime": { "min": "1s", "max": "2s" } },
        { "id": "search", "name": "Arama",
          "request": { "url": "{{base}}/api/search", "query": [ { "key": "q", "value": "ürün {{$randInt 1 500}}" } ] },
          "checks": [ { "type": "status", "value": 200 } ],
          "thinkTime": { "min": "1s", "max": "3s" } }
      ]
    }
  ],
  "thresholds": [
    { "metric": "req_duration", "expr": "p(95)<800" },
    { "metric": "req_failed", "expr": "rate<0.01" }
  ]
}
