benchttp / server

REST API for benchttp.
Other
0 stars 0 forks source link

feat: json struct tags for Report #17

Closed moreirathomas closed 2 years ago

moreirathomas commented 2 years ago

Description

Add json struct tags to benchttp.Report to correctly marshal the struct when responding via http.

Changes

Then:

{
  "Benchmark": {
    "Records": []
  },
  "Metadata": {
    "Config": {
      "Output": {}
    },
  }
}

Now:

{
  "benchmark": {
    "records": []
  },
  "metadata": {
    "config": {}
  }
}

Also, Report.Metadata.Output is omitted from the marshalled response.