code: func (f *processState) Process(event Event) {
  	switch event.Name {
  	// Ready event means Teleport has started successfully.
  	case TeleportReadyEvent:
  		atomic.StoreInt64(&f.currentState, stateOK)
  		f.process.Infof("Detected that service started and joined the cluster successfully.")
  	// If a degraded event was received, always change the state to degraded.
  	case TeleportDegradedEvent:
  		atomic.StoreInt64(&f.currentState, stateDegraded)
  		f.process.Infof("Detected Teleport is running in a degraded state.")
  	// If the current state is degraded, and a OK event has been
  	// received, change the state to recovering. If the current state is
  	// recovering and a OK events is received, if it's been longer
  	// than the recovery time (2 time the server keep alive ttl), change
  	// state to OK.
  	case TeleportOKEvent:
  		switch atomic.LoadInt64(&f.currentState) {
  		case stateDegraded:
  			atomic.StoreInt64(&f.currentState, stateRecovering)
  			f.recoveryTime = f.process.Clock.Now()
  			f.process.Infof("Teleport is recovering from a degraded state.")
  		case stateRecovering:
  			if f.process.Clock.Now().Sub(f.recoveryTime) > defaults.ServerKeepAliveTTL*2 {
  				atomic.StoreInt64(&f.currentState, stateOK)
  				f.process.Infof("Teleport has recovered from a degraded state.")
  			}
  		}
  	}
  }
docs: // Process updates the state of Teleport.