code: func (s *Segment) Close() {
  	s.Lock()
  	defer s.Unlock()
  
  	s.EndTime = now()
  	s.InProgress = false
  	if s.Parent != nil {
  		s.Parent.decrementCounter()
  	}
  	if s.counter <= 0 {
  		s.flush()
  	}
  }
docs: // Close closes the segment by setting its EndTime.