示例#1
0
        private void OnExecuting <T>(DbCommand command, DbCommandInterceptionContext <T> interceptionContext)
        {
            var sw = new Stopwatch();

            interceptionContext.SetUserState("sw", sw);
            sw.Start();
        }
示例#2
0
        private void Execiting <T>(DbCommandInterceptionContext <T> interceptionContext)
        {
            var timer = new Stopwatch();

            interceptionContext.SetUserState("timer", timer);
            timer.Start();
        }
示例#3
0
            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);
            }
示例#4
0
 public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext <object> interceptionContext)
 {
     interceptionContext.SetUserState("start", DateTime.Now);
 }
示例#5
0
 public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext <int> interceptionContext)
 {
     interceptionContext.SetUserState("start", DateTime.Now);
 }
示例#6
0
 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);