benchttp / engine

Benchttp library in Go to run performance tests on HTTP endpoints.
Other
4 stars 1 forks source link

fix(server): conventional camel-cased JSON responses #44

Closed GregoryAlbouy closed 2 years ago

GregoryAlbouy commented 2 years ago

Description

Note: all keys are in lower camel-case format, except request event names. The reason is they are identifiers, not just keys, and they're used as-is by the front-end.

Progress output example
{
  "done": false,
  "error": null,
  "doneCount": 3,
  "maxCount": 5,
  "timeout": 30000000000,
  "elapsed": 500576066
}

Report output example
{
  "metadata": {
    "finishedAt": "2022-09-09T18:03:45.216544+02:00",
    "totalDuration": 1004402876
  },
  "metrics": {
    "responseTimes": {
      "min": 80761084,
      "max": 333827332,
      "mean": 131707239,
      "median": 81239959,
      "standardDeviation": 101060311,
      "quartiles": [81235163, 81239959, 81472659, 333827332],
      "deciles": null
    },
    "statusCodesDistribution": { "200": 5 },
    "requestEventTimes": {
      "BodyRead": {
        "min": 80761084,
        "max": 333827332,
        "mean": 131707239,
        "median": 81239959,
        "standardDeviation": 101060311,
        "quartiles": [81235163, 81239959, 81472659, 333827332],
        "deciles": null
      },
      "ConnectDone": {
        "min": 82509680,
        "max": 82509680,
        "mean": 82509680,
        "median": 82509680,
        "standardDeviation": 0,
        "quartiles": null,
        "deciles": null
      },
      "DNSDone": {
        "min": 1210949,
        "max": 1210949,
        "mean": 1210949,
        "median": 1210949,
        "standardDeviation": 0,
        "quartiles": null,
        "deciles": null
      },
      "GotFirstResponseByte": {
        "min": 80609188,
        "max": 333639052,
        "mean": 131536899,
        "median": 81075030,
        "standardDeviation": 101051349,
        "quartiles": [81017510, 81075030, 81343718, 333639052],
        "deciles": null
      },
      "TLSHandshakeDone": {
        "min": 251534759,
        "max": 251534759,
        "mean": 251534759,
        "median": 251534759,
        "standardDeviation": 0,
        "quartiles": null,
        "deciles": null
      },
      "WroteHeaders": {
        "min": 103660,
        "max": 251729725,
        "mean": 50450882,
        "median": 126524,
        "standardDeviation": 100639424,
        "quartiles": [116665, 126524, 177839, 251729725],
        "deciles": null
      },
      "WroteRequest": {
        "min": 110456,
        "max": 251730332,
        "mean": 50453061,
        "median": 127795,
        "standardDeviation": 100638638,
        "quartiles": [117407, 127795, 179316, 251730332],
        "deciles": null
      }
    },
    "records": [
      { "responseTime": 333827332 },
      { "responseTime": 81472659 },
      { "responseTime": 81235163 },
      { "responseTime": 81239959 },
      { "responseTime": 80761084 }
    ],
    "requestFailures": [],
    "requestCount": 5,
    "requestSuccessCount": 5,
    "requestFailureCount": 0
  },
  "tests": {
    "pass": false,
    "results": [
      {
        "pass": true,
        "summary": "want ResponseTimes.Min \u003e 80ms, got 80.761084ms",
        "input": {
          "name": "minimum response time",
          "field": "ResponseTimes.Min",
          "predicate": "GT",
          "target": 80000000
        }
      },
      {
        "pass": false,
        "summary": "want ResponseTimes.Max \u003c= 120ms, got 333.827332ms",
        "input": {
          "name": "maximum response time",
          "field": "ResponseTimes.Max",
          "predicate": "LTE",
          "target": 120000000
        }
      },
      {
        "pass": false,
        "summary": "want RequestFailureCount == 5, got 0",
        "input": {
          "name": "100% availability",
          "field": "RequestFailureCount",
          "predicate": "EQ",
          "target": 5
        }
      }
    ]
  }
}

Changes

API changes:

Notes