/// <summary> /// Creates new instance of transaction enry and starts benchmarking. /// </summary> /// <param name="transactionId">The transaction identifier.</param> /// <returns>New transaction entry object</returns> public static TransactionEntry CreateAndStartTransaction(int transactionId) { TransactionEntry transaction = new TransactionEntry(transactionId); transaction.stopwatch.Start(); return(transaction); }
/// <inheritdoc /> public void StartTransaction(Snapshot snapshot) { if (!transactions.ContainsKey(snapshot)) { TransactionEntry entry = TransactionEntry.CreateAndStartTransaction(++transactionCounter); transactions.Add(snapshot, entry); } }
/// <summary> /// Initializes a new instance of the <see cref="AlgorithmEntry"/> class. /// </summary> /// <param name="algorithmType">Type of the algorithm.</param> /// <param name="transaction">The transaction.</param> private AlgorithmEntry(AlgorithmType algorithmType, TransactionEntry transaction) { this.AlgorithmType = algorithmType; this.Transaction = transaction; stopwatch = new Stopwatch(); }
/// <summary> /// Creates the the algorithm entry object and starts measuring the statistics. /// </summary> /// <param name="algorithmType">Type of the algorithm.</param> /// <param name="transaction">The transaction.</param> /// <returns>New created algorithm object.</returns> public static AlgorithmEntry CreateAndStartAlgorithm(AlgorithmType algorithmType, TransactionEntry transaction) { AlgorithmEntry entry = new AlgorithmEntry(algorithmType, transaction); entry.stopwatch.Start(); return(entry); }