code: func (ss *FileSubStore) shouldCompact() bool {
  	// Gobal switch
  	if !ss.opts.CompactEnabled {
  		return false
  	}
  	// Check that if minimum file size is set, the client file
  	// is at least at the minimum.
  	if ss.opts.CompactMinFileSize > 0 && ss.fileSize < ss.opts.CompactMinFileSize {
  		return false
  	}
  	// Check fragmentation
  	frag := 0
  	if ss.numRecs == 0 {
  		frag = 100
  	} else {
  		frag = ss.delRecs * 100 / ss.numRecs
  	}
  	if frag < ss.opts.CompactFragmentation {
  		return false
  	}
  	// Check that we don't compact too often
  	if time.Since(ss.compactTS) < ss.compactItvl {
  		return false
  	}
  	return true
  }
docs: // shouldCompact returns a boolean indicating if we should compact
  // Lock is held by caller