code: def record_stage_state(self, phase, stage):
          
  
          key = '{}-{}'.format(phase, stage if stage else 1)
  
          self.buildstate.state[key] = time()
docs: Record the completion times of phases and stages