Esempio n. 1
0
        public ICommit Commit(CommitAttempt attempt)
        {
            Stopwatch clock  = Stopwatch.StartNew();
            ICommit   commit = _persistence.Commit(attempt);

            clock.Stop();
            _counters.CountCommit(attempt.Events.Count, clock.ElapsedMilliseconds);
            return(commit);
        }
        public virtual void Commit(Commit attempt)
        {
            Stopwatch clock = Stopwatch.StartNew();

            _persistence.Commit(attempt);
            clock.Stop();

            _counters.CountCommit(attempt.Events.Count, clock.ElapsedMilliseconds);
        }
        public async Task <ICommit> CommitAsync(CommitAttempt attempt, CancellationToken cancellationToken)
        {
            var clock = Stopwatch.StartNew();

            var commit = await _persistence
                         .CommitAsync(attempt, cancellationToken)
                         .ConfigureAwait(false);

            clock.Stop();
            _counters.CountCommit(attempt.Events.Count, clock.ElapsedMilliseconds);

            return(commit);
        }