class LoggingPhaseTracker implements PhaseTracker {

    @Override
    public void enterPhase( Phase phase )
    {
        if ( stopped )
        {
            throw new IllegalStateException( "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;
            }
        }
    }

      LoggingPhaseTracker( Log log );
    @VisibleForTesting  LoggingPhaseTracker( long periodIntervalInSeconds, Log log, Clock clock );

}