Documentation ¶
Overview ¶
Package sqlregressionstore implements the regression.Store interface on an SQL database backend.
To see the schema of the database used, see perf/sql/migrations.
Index ¶
- type SQLRegressionStore
- func (s *SQLRegressionStore) DeleteByCommit(ctx context.Context, num types.CommitNumber, tx pgx.Tx) error
- func (s *SQLRegressionStore) GetByIDs(ctx context.Context, ids []string) ([]*regression.Regression, error)
- func (s *SQLRegressionStore) GetNotificationId(ctx context.Context, commitNumber types.CommitNumber, alertID string) (string, error)
- func (s *SQLRegressionStore) GetOldestCommit(ctx context.Context) (*types.CommitNumber, error)
- func (s *SQLRegressionStore) GetRegressionsBySubName(ctx context.Context, sub_name string, limit int, offset int) ([]*regression.Regression, error)
- func (s *SQLRegressionStore) GetRegressionsToMigrate(ctx context.Context, batchSize int) ([]*regression.Regression, error)
- func (s *SQLRegressionStore) MarkMigrated(ctx context.Context, regressionId string, commitNumber types.CommitNumber, ...) error
- func (s *SQLRegressionStore) Range(ctx context.Context, begin, end types.CommitNumber) (map[types.CommitNumber]*regression.AllRegressionsForCommit, error)
- func (s *SQLRegressionStore) SetHigh(ctx context.Context, commitNumber types.CommitNumber, alertID string, ...) (bool, string, error)
- func (s *SQLRegressionStore) SetLow(ctx context.Context, commitNumber types.CommitNumber, alertID string, ...) (bool, string, error)
- func (s *SQLRegressionStore) TriageHigh(ctx context.Context, commitNumber types.CommitNumber, alertID string, ...) error
- func (s *SQLRegressionStore) TriageLow(ctx context.Context, commitNumber types.CommitNumber, alertID string, ...) error
- func (s *SQLRegressionStore) Write(ctx context.Context, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLRegressionStore ¶
type SQLRegressionStore struct {
// contains filtered or unexported fields
}
SQLRegressionStore implements the regression.Store interface.
func New ¶
func New(db pool.Pool) (*SQLRegressionStore, error)
New returns a new *SQLRegressionStore.
We presume all migrations have been run against db before this function is called.
func (*SQLRegressionStore) DeleteByCommit ¶
func (s *SQLRegressionStore) DeleteByCommit(ctx context.Context, num types.CommitNumber, tx pgx.Tx) error
DeleteByCommit implements the regression.Store interface. Deletes a regression via commit number.
func (*SQLRegressionStore) GetByIDs ¶
func (s *SQLRegressionStore) GetByIDs(ctx context.Context, ids []string) ([]*regression.Regression, error)
Not implemented as old regression schema does not have id.
func (*SQLRegressionStore) GetNotificationId ¶
func (s *SQLRegressionStore) GetNotificationId(ctx context.Context, commitNumber types.CommitNumber, alertID string) (string, error)
GetNotificationId returns the notificationID for the regression at the given commit for specific alert.
func (*SQLRegressionStore) GetOldestCommit ¶
func (s *SQLRegressionStore) GetOldestCommit(ctx context.Context) (*types.CommitNumber, error)
GetOldestCommit implements the regression.Store interface. Gets the oldest commit in the table.
func (*SQLRegressionStore) GetRegressionsBySubName ¶
func (s *SQLRegressionStore) GetRegressionsBySubName(ctx context.Context, sub_name string, limit int, offset int) ([]*regression.Regression, error)
Unimplemented: This function is implemented by regression2 store
func (*SQLRegressionStore) GetRegressionsToMigrate ¶
func (s *SQLRegressionStore) GetRegressionsToMigrate(ctx context.Context, batchSize int) ([]*regression.Regression, error)
GetRegressionsToMigrate returns a set of regressions which are available to be migrated.
func (*SQLRegressionStore) MarkMigrated ¶
func (s *SQLRegressionStore) MarkMigrated(ctx context.Context, regressionId string, commitNumber types.CommitNumber, alertID int64, tx pgx.Tx) error
MarkMigrated marks a specific row in the regressions table as migrated.
func (*SQLRegressionStore) Range ¶
func (s *SQLRegressionStore) Range(ctx context.Context, begin, end types.CommitNumber) (map[types.CommitNumber]*regression.AllRegressionsForCommit, error)
Range implements the regression.Store interface.
func (*SQLRegressionStore) SetHigh ¶
func (s *SQLRegressionStore) SetHigh(ctx context.Context, commitNumber types.CommitNumber, alertID string, df *frame.FrameResponse, high *clustering2.ClusterSummary) (bool, string, error)
SetHigh implements the regression.Store interface.
func (*SQLRegressionStore) SetLow ¶
func (s *SQLRegressionStore) SetLow(ctx context.Context, commitNumber types.CommitNumber, alertID string, df *frame.FrameResponse, low *clustering2.ClusterSummary) (bool, string, error)
SetLow implements the regression.Store interface.
func (*SQLRegressionStore) TriageHigh ¶
func (s *SQLRegressionStore) TriageHigh(ctx context.Context, commitNumber types.CommitNumber, alertID string, tr regression.TriageStatus) error
TriageHigh implements the regression.Store interface.
func (*SQLRegressionStore) TriageLow ¶
func (s *SQLRegressionStore) TriageLow(ctx context.Context, commitNumber types.CommitNumber, alertID string, tr regression.TriageStatus) error
TriageLow implements the regression.Store interface.
func (*SQLRegressionStore) Write ¶
func (s *SQLRegressionStore) Write(ctx context.Context, regressions map[types.CommitNumber]*regression.AllRegressionsForCommit) error
Write implements the regression.Store interface.