execution_metrics 3.0.0
execution_metrics: ^3.0.0 copied to clipboard
Measure and report how long functions take to run in Dart and Flutter apps.
3.0.0 #
- Breaking: now a pure Dart package (no Flutter dependency); works in Flutter, CLI and server apps. Requires Dart
>=3.0.0. - Breaking:
TaskResultis built from aDuration elapsed.minutes,secondsandmillisecondsare now getters; useelapsedortotalMillisecondsfor the total time (secondsandmillisecondsare only components, 0-59 / 0-999). - Breaking:
stop()withoutstart(), orstart()while running, throws aStateError. - Breaking:
boxContentWidthis derived fromcolWidth(read-only), so the report box always stays aligned. - Fixed: reusing an instance accumulated the previous measurement.
- Fixed:
deviceInfois consistentlynullwhen absent and survives a JSON round trip.toJsonaddselapsedMicroseconds;fromJsonstill reads the old format. - Fixed: long task names are truncated instead of breaking the box.
- Fixed: in
run/runAsync, a failing callback no longer hides the action's error. - Added
ExecutionMetrics.loggerto redirect the report or disable it (null),formatReport, andisRunning. - Added
==,hashCodeandtoStringtoTaskResult, and aconstconstructor. - Callbacks are typed
void Function(TaskResult). - Code moved to
lib/src; importpackage:execution_metrics/execution_metrics.dart. The oldmappers/andmodels/imports still work but are deprecated.
2.0.0 #
- Added
runandrunAsynchelpers with named parameters and return value passthrough. - Enhanced callback to receive
TaskResultobject. - Made print formatting configurable (
ExecutionMetrics.boxContentWidth,ExecutionMetrics.colWidth). - Breaking: the callback now receives a
TaskResultinstead of the previous value.
1.1.0 #
- Added optional
deviceInfoparameter.
1.0.1 #
- Add flutter compatibility
1.0.0 #
- initial release