private void OnExecuting <T>(DbCommand command, DbCommandInterceptionContext <T> interceptionContext) { var sw = new Stopwatch(); interceptionContext.SetUserState("sw", sw); sw.Start(); }
private void Execiting <T>(DbCommandInterceptionContext <T> interceptionContext) { var timer = new Stopwatch(); interceptionContext.SetUserState("timer", timer); timer.Start(); }
private void DoStartSpan <TResult>(IDbCommand command, DbCommandInterceptionContext <TResult> interceptCtx, string dbgOriginalCaller) { if (Agent.Instance.Tracer.CurrentTransaction == null) { _logger.Debug()?.Log("There's' no current transaction - skipping starting span for DB-operation-started event"); return; } LogEvent("DB operation started - starting a new span...", command, interceptCtx, dbgOriginalCaller); var span = Agent.Instance.TracerInternal.DbSpanCommon.StartSpan(Agent.Instance, command, InstrumentationFlag.EfClassic); interceptCtx.SetUserState(_userStateKey, span); }
public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext) { interceptionContext.SetUserState("start", DateTime.Now); }
public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext) { interceptionContext.SetUserState("start", DateTime.Now); }
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext <DbDataReader> interceptionContext) { interceptionContext.SetUserState("start", DateTime.Now); }
internal static void AttachSpan <T>(this DbCommandInterceptionContext <T> interceptionContext, ISpan span) => interceptionContext.SetUserState(SentryQueryPerformanceListener.SentryUserStateKey, span);