OfflineSyncDiagnostics class
Opt-in performance measurements scoped to one asynchronous operation, including streams subscribed inside run. Events omit domain payloads and SQL, but may include user, space and node identifiers supplied by instrumented operations. Durations use a monotonic clock local to the operation, not wall-clock time.
For benchmarks and performance investigations only, imported from
package:serverpod_offline_sync/diagnostics.dart. This is not an analytics,
audit or telemetry hook: events follow the sync internals and change without
notice.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- enabled → bool
-
Whether the current asynchronous operation has a diagnostics consumer.
no setter
- monotonicMicros → int
-
A shared monotonic timestamp for correlations within this isolate.
It has no wall-clock meaning and cannot be compared across processes.
no setter
Static Methods
-
event(
String name, [Map< String, Object?> data = const {}]) → void - Emits a point-in-time observation. Values must be JSON serializable.
-
measure<
T> (String name, Future< T> action(), {Map<String, Object?> data = const {}}) → Future<T> -
Times
action, retaining its result, exception and cancellation behavior. -
run<
T> (OfflineSyncDiagnosticSink sink, T action()) → T -
Runs
actionwith a new monotonic timeline, inherited by its async work. -
transaction<
T> (Database database, TransactionFunction< T> action, {TransactionSettings? settings}) → Future<T> - Measures the transaction boundary supported by Serverpod's public API. Callback entry occurs after pool acquisition AND BEGIN. Completion after the callback includes commit/rollback and connection release. Neither is claimed to be a measurement of a driver operation in isolation.