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