square brackets surrounding jmh.json contents

Aleksey Shipilev shade at redhat.com
Wed Jul 19 18:48:17 UTC 2017


On 07/18/2017 11:01 PM, Eric Caspole wrote:
> Hi Aleksey,
> Do you remember why the jmh.json format results are surrounded with [ ] where
> AFAICT that is not part of JSON syntax?
> 
> This is seen in src/main/java/org/openjdk/jmh/results/format/JSONResultFormat.java
> 
> Thanks,
> Eric
> 
> For example I got a file like:
> 
> $ more jmh.json
> [
>     {
>         "benchmark" : "fee.fi.fo.Fum",
>         "mode" : "avgt",
>         "threads" : 1,
> 
> ...
>     }
> ]

I think this is because there could be multiple benchmark results, and []
denotes the array of them? The example above has a single result, and it is
still wrapped in a single-element array for consistency.

-Aleksey



More information about the jmh-dev mailing list