code: func (s *memSeries) append(t int64, v float64) (success, chunkCreated bool) {
  	// Based on Gorilla white papers this offers near-optimal compression ratio
  	// so anything bigger that this has diminishing returns and increases
  	// the time range within which we have to decompress all samples.
  	const samplesPerChunk = 120
  
  	c := s.head()
  
  	if c == nil {
  		c = s.cut(t)
  		chunkCreated = true
  	}
  	numSamples := c.chunk.NumSamples()
  
  	// Out of order sample.
  	if c.maxTime >= t {
  		return false, chunkCreated
  	}
  	// If we reach 25% of a chunk's desired sample count, set a definitive time
  	// at which to start the next chunk.
  	// At latest it must happen at the timestamp set when the chunk was cut.
  	if numSamples == samplesPerChunk/4 {
  		s.nextAt = computeChunkEndTime(c.minTime, c.maxTime, s.nextAt)
  	}
  	if t >= s.nextAt {
  		c = s.cut(t)
  		chunkCreated = true
  	}
  	s.app.Append(t, v)
  
  	c.maxTime = t
  
  	s.sampleBuf[0] = s.sampleBuf[1]
  	s.sampleBuf[1] = s.sampleBuf[2]
  	s.sampleBuf[2] = s.sampleBuf[3]
  	s.sampleBuf[3] = sample{t: t, v: v}
  
  	return true, chunkCreated
  }
docs: // append adds the sample (t, v) to the series.