toJson method

Map<String, dynamic> toJson()

Converts stats payload to JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'fps': double.parse(fps.toStringAsFixed(1)),
    'processingTimeMs': double.parse(processingTimeMs.toStringAsFixed(1)),
    'memoryMb': double.parse(memoryMb.toStringAsFixed(1)),
    'droppedFrames': droppedFrames,
    'processedFrames': processedFrames,
    'cpuUsageEstimate': double.parse(cpuUsageEstimate.toStringAsFixed(1)),
    'timestamp': timestamp.toIso8601String(),
  };
}