prow/tide/history/history.go
func New(maxRecordsPerKey int, opener io.Opener, path string) (*History, error) {
	hist := &History{
		logs:         map[string]*recordLog{},
		logSizeLimit: maxRecordsPerKey,
		opener:       opener,
		path:         path,
	}

	if path != "" {
		// Load existing history from GCS.
		var err error
		start := time.Now()
		hist.logs, err = readHistory(maxRecordsPerKey, hist.opener, hist.path)
		if err != nil {
			return nil, err
		}
		logrus.WithFields(logrus.Fields{
			"duration": time.Since(start).String(),
			"path":     hist.path,
		}).Debugf("Successfully read action history for %d pools.", len(hist.logs))
	}

	return hist, nil
}
func New(maxRecordsPerKey int, opener io.Opener, path string) (*History, error) {
	hist := &History{
		logs:         map[string]*recordLog{},
		logSizeLimit: maxRecordsPerKey,
		opener:       opener,
		path:         path,
	}

	if path != "" {
		// Load existing history from GCS.
		var err error
		start := time.Now()
		hist.logs, err = readHistory(maxRecordsPerKey, hist.opener, hist.path)
		if err != nil {
			return nil, err
		}
		logrus.WithFields(logrus.Fields{
			"duration": time.Since(start).String(),
			"path":     hist.path,
		}).Debugf("Successfully read action history for %d pools.", len(hist.logs))
	}

	return hist, nil
}
func New ( maxRecordsPerKey int , opener io . Opener , path string ) ( * History , error ) { hist := & History { logs : map [ string ] * recordLog { } , logSizeLimit : maxRecordsPerKey , opener : opener , path : path , } if path != " " { // Load existing history from GCS. var err error start := time . Now ( ) hist . logs , err = readHistory ( maxRecordsPerKey , hist . opener , hist . path ) if err != nil { return nil , err } logrus . WithFields ( logrus . Fields { " " : time . Since ( start ) . String ( ) , " " : hist . path , } ) . Debugf ( " " , len ( hist . logs ) ) } return hist , nil }
// New creates a new History struct with the specificed recordLog size limit.
New creates a new History struct with the specificed recordLog size limit .