Class QueryObservability
Process-wide sink for query lifecycle notifications. Query pipelines call the
lightweight Record* methods without needing an CodeLogic.Core.Events.IEventBus
instance passed through. The library wires the sink to CodeLogic's event bus at
init time.
public static class QueryObservability
- Inheritance
-
QueryObservability
- Inherited Members
Methods
Configure(IEventBus?, ILogger?)
Bind this sink to CodeLogic's event bus. Called by MySQL2Library.
public static void Configure(IEventBus? events, ILogger? logger)
Parameters
eventsIEventBusloggerILogger
RecordCacheHit(string, string, string)
public static void RecordCacheHit(string connectionId, string tableName, string cacheKey)
Parameters
RecordCacheMiss(string, string, string)
public static void RecordCacheMiss(string connectionId, string tableName, string cacheKey)
Parameters
RecordExecuted(string, string, long, int, bool)
Fire QueryExecutedEvent; always, regardless of speed.
public static void RecordExecuted(string connectionId, string sql, long elapsedMs, int rowCount, bool cacheHit)
Parameters
RecordN1(string, string, int)
public static void RecordN1(string connectionId, string template, int count)
Parameters
RecordSlow(string, string, long, string?)
Fire SlowQueryEvent and log. explainJson is only
included when the per-DB CaptureExplainOnSlowQuery flag is on and the
caller has fetched the plan.
public static void RecordSlow(string connectionId, string sql, long elapsedMs, string? explainJson = null)