Exemple #1
0
        /// <summary>Takes current snapshot.</summary>
        /// <remarks>Not thread-safe. Caller should ensure that it's not called from different threads at once.</remarks>
        public ConsensusManagerPerformanceSnapshot TakeSnapshot()
        {
            var newSnapshot = new ConsensusManagerPerformanceSnapshot(this.chainIndexer);
            ConsensusManagerPerformanceSnapshot previousSnapshot = this.currentSnapshot;

            this.currentSnapshot = newSnapshot;

            return(previousSnapshot);
        }
Exemple #2
0
 public ConsensusManagerPerformanceCounter(ChainIndexer chainIndexer)
 {
     this.chainIndexer    = chainIndexer;
     this.currentSnapshot = new ConsensusManagerPerformanceSnapshot(this.chainIndexer);
 }