
SlowQueryLog
- Namespace
- Rowles.LeanLucene.Diagnostics
- Assembly
- Rowles.LeanLucene.dll
Logs individual queries that exceed a configurable latency threshold. Output is one JSON object per line (JSON Lines format).
public sealed class SlowQueryLog : IDisposable
SlowQueryLog
Constructors
SlowQueryLog(double, TextWriter, bool)
Creates a slow query log that writes to the given System.IO.TextWriter.
Properties
IncludeExplain
Whether to include query explain output in log entries.
ThresholdMs
Minimum elapsed milliseconds before a query is logged.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
MaybeLog(Query, TimeSpan, int)
Records a query execution. If elapsed exceeds the threshold, writes a JSON line to the output.
ToFile(double, string)
Creates a slow query log that appends to a file.