code: func (w *SegmentWAL) LogSeries(series []RefSeries) error {
  	buf := w.getBuffer()
  
  	flag := w.encodeSeries(buf, series)
  
  	w.mtx.Lock()
  	defer w.mtx.Unlock()
  
  	err := w.write(WALEntrySeries, flag, buf.Get())
  
  	w.putBuffer(buf)
  
  	if err != nil {
  		return errors.Wrap(err, "log series")
  	}
  
  	tf := w.head()
  
  	for _, s := range series {
  		if tf.minSeries > s.Ref {
  			tf.minSeries = s.Ref
  		}
  	}
  	return nil
  }
docs: // LogSeries writes a batch of new series labels to the log.
  // The series have to be ordered.