Support for tracking database calls #1025
-
I'm looking for a solution that would allow me to add a tracking layer (with timings) to all database requests so that I can track them as I can't seem to see a path forward at this stage, without wrapping calls in the API individually. Is there any appetite to add support for something like this? And if so, are there any proposed API's that have been suggested? Current optionsIDocumentSessionListenerLooking at the public interface IDocumentSessionListener
{
void BeforeSaveChanges(IDocumentSession session);
Task BeforeSaveChangesAsync(IDocumentSession session, CancellationToken token);
void AfterCommit(IDocumentSession session, IChangeSet commit);
Task AfterCommitAsync(IDocumentSession session, IChangeSet commit, CancellationToken token);
void DocumentLoaded(object id, object document);
void DocumentAddedForStorage(object id, object document);
} IMartenSessionLoggerThere are also no points in the public interface IMartenSessionLogger
{
void LogSuccess(NpgsqlCommand command);
void LogFailure(NpgsqlCommand command, Exception ex);
void RecordSavedChanges(IDocumentSession session, IChangeSet commit);
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@sandcastle This has come up a couple times. My first suggestion would be to look at the raw tracing in Npgsql itself. You can build and register an |
Beta Was this translation helpful? Give feedback.
@sandcastle This has come up a couple times. My first suggestion would be to look at the raw tracing in Npgsql itself.
You can build and register an
IDocumentSessionListener
at runtime and add that to a session now (think that was 2.5).