/// <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); }
public ConsensusManagerPerformanceCounter(ChainIndexer chainIndexer) { this.chainIndexer = chainIndexer; this.currentSnapshot = new ConsensusManagerPerformanceSnapshot(this.chainIndexer); }