code: func (s *Segment) decrementCounter() {
  	s.Lock()
  	defer s.Unlock()
  
  	s.counter--
  	if s.counter <= 0 && s.EndTime != 0 {
  		// Segment is closed and last subsegment closed, flush it
  		s.flush()
  	}
  }
docs: // decrementCounter decrements the segment counter and flushes it if it's 0.