getReport static method
Return a full snapshot of all recorded metrics.
Implementation
static Map<String, dynamic> getReport() {
final avgDurations = <String, String>{};
_operationTimes.forEach((key, _) {
final avg = getAverageDuration(key);
if (avg != null) avgDurations[key] = '${avg.inMicroseconds / 1000.0}ms';
});
return {
'controllers': {
'active': activeControllers,
'created': totalControllersCreated,
'disposed': totalControllersDisposed,
'byType': Map.from(controllerCreationCount),
},
'counters': Map.from(_counters),
'performance': {
'averageDurations': avgDurations,
},
};
}