toJson method

Map<String, Object?> toJson()

Serializes the benchmark metric to a JSON object.

Implementation

Map<String, Object?> toJson() {
  return <String, Object?>{
    metricKey: metric,
    valueKey: value,
    if (delta != null) deltaKey: delta,
  };
}