public override void Stop() { _stopped = true; LogCurrentTime(); _currentPhase = null; FinalReport(); }
public override void EnterPhase(PhaseTracker_Phase phase) { if (_stopped) { throw new System.InvalidOperationException("Trying to report a new phase after phase tracker has been stopped."); } if (phase != _currentPhase) { long now = LogCurrentTime(); _currentPhase = phase; _timeEnterPhase = now; if (_lastPeriodReport == -1) { _lastPeriodReport = now; } long millisSinceLastPeriodReport = now - _lastPeriodReport; if (millisSinceLastPeriodReport >= _periodInterval) { // Report period PeriodReport(millisSinceLastPeriodReport); _lastPeriodReport = now; } } }
internal Logger(LoggingPhaseTracker outerInstance, PhaseTracker_Phase phase) : base(outerInstance, phase) { this._outerInstance = outerInstance; PeriodCounter = new Counter(outerInstance, phase); PeriodCounter.reset(); }
internal Counter(LoggingPhaseTracker outerInstance, PhaseTracker_Phase phase) { this._outerInstance = outerInstance; this.Phase = phase; }
public override void EnterPhase(PhaseTracker_Phase phase) { }