MetricsQueryLogger class
A query logger that collects metrics.
Useful for monitoring performance and identifying slow queries.
- Implemented types
Constructors
- MetricsQueryLogger({int maxMetrics = 1000})
Properties
- averageDuration → Duration
-
Average query duration
no setter
-
byOperation
→ Map<
String, List< QueryMetric> > -
Queries grouped by operation
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
metrics
→ List<
QueryMetric> -
All collected metrics
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slowestQuery → QueryMetric?
-
Slowest query
no setter
- totalDuration → Duration
-
Total execution time
no setter
- totalQueries → int
-
Total number of queries executed
no setter
Methods
-
clear(
) → void - Clear all collected metrics
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onQueryEnd(
QueryEndEvent event) → void -
Called after a query completes successfully.
override
-
onQueryError(
QueryErrorEvent event) → void -
Called when a query fails.
override
-
onQueryStart(
QueryStartEvent event) → void -
Called before a query is executed.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited