code: func NewCollector(out io.Writer) *Collector {
  	ts := &Collector{
  		indexes: make(map[string]int),
  		out:     out,
  	}
  	go func() {
  		tick := time.NewTicker(time.Second * 2)
  		for ; ; <-tick.C {
  			ts.write()
  		}
  	}()
  	return ts
  }
docs: // NewCollector initializes and returns a new TermStat.