code: func NewHead(r prometheus.Registerer, l log.Logger, wal *wal.WAL, chunkRange int64) (*Head, error) {
  	if l == nil {
  		l = log.NewNopLogger()
  	}
  	if chunkRange < 1 {
  		return nil, errors.Errorf("invalid chunk range %d", chunkRange)
  	}
  	h := &Head{
  		wal:        wal,
  		logger:     l,
  		chunkRange: chunkRange,
  		minTime:    math.MaxInt64,
  		maxTime:    math.MinInt64,
  		series:     newStripeSeries(),
  		values:     map[string]stringset{},
  		symbols:    map[string]struct{}{},
  		postings:   index.NewUnorderedMemPostings(),
  		deleted:    map[uint64]int{},
  	}
  	h.metrics = newHeadMetrics(h, r)
  
  	return h, nil
  }
docs: // NewHead opens the head block in dir.