예제 #1
0
 public override void Stop()
 {
     _stopped = true;
     LogCurrentTime();
     _currentPhase = null;
     FinalReport();
 }
예제 #2
0
        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;
                }
            }
        }
예제 #3
0
 internal Logger(LoggingPhaseTracker outerInstance, PhaseTracker_Phase phase) : base(outerInstance, phase)
 {
     this._outerInstance = outerInstance;
     PeriodCounter       = new Counter(outerInstance, phase);
     PeriodCounter.reset();
 }
예제 #4
0
 internal Counter(LoggingPhaseTracker outerInstance, PhaseTracker_Phase phase)
 {
     this._outerInstance = outerInstance;
     this.Phase          = phase;
 }
예제 #5
0
 public override void EnterPhase(PhaseTracker_Phase phase)
 {
 }