/// <summary> /// Registers a transaction stop event that occured within the connection. /// </summary> /// <param name="transaction">The transaction itself.</param> public void RegisterTransactionEnd(TransactionMetadata transaction) { var command = Commands.LastOrDefault(x => x.Value.Offset <= transaction.Offset + transaction.Duration); if (command.Value != null) { command.Value.TailTransaction = transaction; } }
/// <summary> /// Registers a transaction start event that occured within the connection. /// </summary> /// <param name="transaction">The transaction itself.</param> public void RegisterTransactionStart(TransactionMetadata transaction) { Transactions.Add(transaction.Id, transaction); var command = Commands.FirstOrDefault(x => x.Value.Offset >= transaction.Offset); if (command.Value != null) { command.Value.HeadTransaction = transaction; } }
private TransactionMetadata GetOrCreateTransactionFor(AdomdTransactionMessage message) { TransactionMetadata transaction; var connectionId = message.ConnectionId.ToString(); var transactionId = message.TransactionId.ToString(); if (!Metadata.Transactions.TryGetValue(transactionId, out transaction)) { transaction = new TransactionMetadata(transactionId, connectionId); Metadata.Transactions.Add(transactionId, transaction); } return(transaction); }
private TransactionMetadata GetOrCreateTransactionFor(AdomdTransactionMessage message) { TransactionMetadata transaction; var connectionId = message.ConnectionId.ToString(); var transactionId = message.TransactionId.ToString(); if (!Metadata.Transactions.TryGetValue(transactionId, out transaction)) { transaction = new TransactionMetadata(transactionId, connectionId); Metadata.Transactions.Add(transactionId, transaction); } return transaction; }