public InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData,
                                                      InterceptionResult result)
        {
            TrackEvent(nameof(DataReaderDisposing), command.Connection, eventData.ConnectionId, eventData.Duration);

            return(result);
        }
Example #2
0
 private void HandleDataReaderDisposing(DataReaderDisposingEventData eventData)
 {
     if (_commands.TryRemove(eventData.CommandId, out var commandMetric))
     {
         commandMetric.Record(eventData);
     }
 }
        public void Record(DataReaderDisposingEventData eventData)
        {
            OnStop();

            Duration = eventData.Duration;
            Rows     = eventData.ReadCount;
            EventMetric.Write(this);
        }
 public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)
 {
     Task.Run(() => easyProfilerService.InsertLogAsync(new Entities.Profiler()
     {
         Query    = command.CommandText,
         Duration = eventData.Duration
     }));
     return(base.DataReaderDisposing(command, eventData, result));
 }
        public InterceptionResult DataReaderDisposing(
            DbCommand command,
            DataReaderDisposingEventData eventData,
            InterceptionResult result)
        {
            Assert.NotNull(eventData.DataReader);

            return(result);
        }
 public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)
 {
     Task.Run(() => context.InsertAsync(new Profiler()
     {
         Query      = command.CommandText,
         Duration   = eventData.Duration.Ticks,
         RequestUrl = httpContextAccessor?.HttpContext?.Request?.Path.Value,
         QueryType  = command.FindQueryType()
     }));
     return(base.DataReaderDisposing(command, eventData, result));
 }
            public InterceptionResult DataReaderDisposing(
                DbCommand command,
                DataReaderDisposingEventData eventData,
                InterceptionResult result)
            {
                for (var i = 0; i < _interceptors.Length; i++)
                {
                    result = _interceptors[i].DataReaderDisposing(command, eventData, result);
                }

                return(result);
            }
Example #8
0
        public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)
        {
            var profilerData = new Profiler
            {
                Duration   = eventData.Duration.Ticks,
                Query      = command.CommandText,
                RequestUrl = httpContextAccessor?.HttpContext?.GetEndpoint()?.DisplayName ?? "Not Http",
                QueryType  = command.FindQueryType(),
                EndDate    = DateTime.UtcNow,
                StartDate  = DateTime.UtcNow - eventData.Duration
            };

            Values.Profilers.Add(profilerData);
            return(base.DataReaderDisposing(command, eventData, result));
        }
Example #9
0
 public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)
 {
     return(base.DataReaderDisposing(command, eventData, result));
 }
Example #10
0
 public InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)
 {
     return(result);
 }
 public InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData,
                                               InterceptionResult result)
 {
     throw new NotImplementedException();
 }