toJson method

Map<String, List<Map<String, Object?>>> toJson()

Serializes benchmark metrics to JSON.

Implementation

Map<String, List<Map<String, Object?>>> toJson() {
  return scores.map<String, List<Map<String, Object?>>>(
      (String benchmarkName, List<BenchmarkScore> scores) {
    return MapEntry<String, List<Map<String, Object?>>>(
      benchmarkName,
      scores.map((BenchmarkScore score) => score.toJson()).toList(),
    );
  });
}