MetricDatapoint.fromJson constructor

MetricDatapoint.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MetricDatapoint.fromJson(Map<String, dynamic> json) {
  return MetricDatapoint(
    average: json['average'] as double?,
    maximum: json['maximum'] as double?,
    minimum: json['minimum'] as double?,
    sampleCount: json['sampleCount'] as double?,
    sum: json['sum'] as double?,
    timestamp: timeStampFromJson(json['timestamp']),
    unit: (json['unit'] as String?)?.toMetricUnit(),
  );
}