HistogramDataPoint.fromJson constructor

HistogramDataPoint.fromJson(
  1. Map<String, dynamic> j
)

Implementation

factory HistogramDataPoint.fromJson(Map<String, dynamic> j) =>
    HistogramDataPoint(
      startTimeUnixNano: _parseMetricInt(j['startTimeUnixNano']) ?? 0,
      timeUnixNano: _parseMetricInt(j['timeUnixNano']) ?? 0,
      count: _parseMetricInt(j['count']) ?? 0,
      sum: _parseMetricNum(j['sum']),
      min: _parseMetricNum(j['min']),
      max: _parseMetricNum(j['max']),
      bucketCounts: (j['bucketCounts'] as List<dynamic>? ?? [])
          .map((value) => _parseMetricInt(value) ?? 0)
          .toList(),
      explicitBounds: (j['explicitBounds'] as List<dynamic>? ?? [])
          .map((value) => _parseMetricNum(value) ?? 0)
          .toList(),
      attributes: (j['attributes'] as List<dynamic>? ?? [])
          .cast<Map<String, dynamic>>()
          .map(Attribute.fromJson)
          .toList(),
    );