Exemple #1
0
 private void HandleCommandEnd(CommandEndEventData eventData)
 {
     if (_commands.TryRemove(eventData.CommandId, out var commandMetric))
     {
         commandMetric.Record(eventData);
     }
 }
        public void Record(CommandEndEventData eventData)
        {
            OnStop();

            Duration = eventData.Duration;
            EventMetric.Write(this);
        }
Exemple #3
0
 public void CommandCanceled(DbCommand command, CommandEndEventData eventData)
 {
     for (var i = 0; i < _interceptors.Length; i++)
     {
         _interceptors[i].CommandCanceled(command, eventData);
     }
 }
        public DbCommand CommandCreated(
            CommandEndEventData eventData,
            DbCommand result)
        {
            for (var i = 0; i < _interceptors.Length; i++)
            {
                result = _interceptors[i].CommandCreated(eventData, result);
            }

            return(result);
        }
Exemple #5
0
 public async Task CommandCanceledAsync(
     DbCommand command,
     CommandEndEventData eventData,
     CancellationToken cancellationToken = default)
 {
     for (var i = 0; i < _interceptors.Length; i++)
     {
         await _interceptors[i].CommandCanceledAsync(command, eventData, cancellationToken)
         .ConfigureAwait(false);
     }
 }
Exemple #6
0
 public override DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)
 {
     return(base.CommandCreated(eventData, result));
 }
Exemple #7
0
 /// <inheritdoc />
 public virtual DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)
 => result;
 public virtual DbCommand CommandCreated(
     CommandEndEventData eventData,
     DbCommand result)
 {
     return(result);
 }
 public DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)
 {
     TrackEvent(nameof(CommandCreated), eventData.Connection, eventData.ConnectionId);
     return(result);
 }
        public override DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)
        {
            AddTransactionTime((int)eventData.Duration.TotalMilliseconds);

            return(base.CommandCreated(eventData, result));
        }