toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
  'startTimeUnixNano': startTimeUnixNano,
  'timeUnixNano': timeUnixNano,
  'count': count,
  if (sum != null) 'sum': sum,
  if (min != null) 'min': min,
  if (max != null) 'max': max,
  if (bucketCounts.isNotEmpty) 'bucketCounts': bucketCounts,
  if (explicitBounds.isNotEmpty) 'explicitBounds': explicitBounds,
  if (attributes.isNotEmpty)
    'attributes': attributes.map((a) => a.toJson()).toList(),
};