code: def end_workunit(self, workunit):
      
  
      additional_data = {
        'outcome': workunit.outcome_string(workunit.outcome()),
        'end_time': workunit.end_time,
        'unaccounted_time': workunit.unaccounted_time(),
      }
  
      root_id = str(workunit.root().id)
  
      # We update the last workunit in the stack, which is always the
      # youngest workunit currently open, and then pop it off. The
      # last workunit serves as a pointer to the child workunit under
      # it's parent (the parent of the youngest workunit currently
      # open is always the one immediately above it in the stack).
      self._root_id_to_workunit_stack[root_id][-1].update(additional_data)
      self._root_id_to_workunit_stack[root_id].pop()
docs: Implementation of Reporter callback.