Documentation ¶
Overview ¶
Package alertrecord contains complex alert types, like the first failure in a version.
Index ¶
- Constants
- Variables
- func ByFirstFailureInTaskType(subscriptionID, versionId, taskName string) db.Q
- func ByFirstFailureInVariant(subscriptionID, versionId, variant string) db.Q
- func ByFirstFailureInVersion(subscriptionID, versionId string) db.Q
- func ByLastFailureTransition(subscriptionID, taskName, variant, projectId string) db.Q
- func InsertNewHostTemporaryExemptionExpirationRecord(hostID string, hours int) error
- func InsertNewSpawnHostExpirationRecord(hostID string, hours int) error
- func InsertNewTaskRegressionByTestRecord(subscriptionID, taskID, testName, taskDisplayName, variant, projectID string, ...) error
- func InsertNewVolumeExpirationRecord(volumeID string, hours int) error
- type AlertRecord
- func FindByFirstRegressionInVersion(subscriptionID, versionId string) (*AlertRecord, error)
- func FindByLastTaskRegressionByTest(subscriptionID, testName, taskDisplayName, variant, projectID string) (*AlertRecord, error)
- func FindByMostRecentTemporaryExemptionExpirationWithHours(hostID string, hours int) (*AlertRecord, error)
- func FindBySpawnHostExpirationWithHours(hostID string, hours int) (*AlertRecord, error)
- func FindByTaskRegressionByTaskTest(subscriptionID, testName, taskDisplayName, variant, projectID, taskID string) (*AlertRecord, error)
- func FindByTaskRegressionTestAndOrderNumber(subscriptionID, testName, taskDisplayName, variant, projectID string, ...) (*AlertRecord, error)
- func FindByVolumeExpirationWithHours(volumeID string, hours int) (*AlertRecord, error)
- func FindOne(query db.Q) (*AlertRecord, error)
Constants ¶
const ( FirstVersionFailureId = "first_version_failure" FirstVariantFailureId = "first_variant_failure" FirstTaskTypeFailureId = "first_tasktype_failure" TaskFailTransitionId = "task_transition_failure" FirstRegressionInVersion = "first_regression_in_version" )
Task triggers
const (
Collection = "alertrecord"
)
Variables ¶
var ( IdKey = bsonutil.MustHaveTag(AlertRecord{}, "Id") TypeKey = bsonutil.MustHaveTag(AlertRecord{}, "Type") TaskIdKey = bsonutil.MustHaveTag(AlertRecord{}, "TaskId") HostIdKey = bsonutil.MustHaveTag(AlertRecord{}, "HostId") VolumeIdKey = bsonutil.MustHaveTag(AlertRecord{}, "VolumeId") TaskNameKey = bsonutil.MustHaveTag(AlertRecord{}, "TaskName") VariantKey = bsonutil.MustHaveTag(AlertRecord{}, "Variant") ProjectIdKey = bsonutil.MustHaveTag(AlertRecord{}, "ProjectId") VersionIdKey = bsonutil.MustHaveTag(AlertRecord{}, "VersionId") RevisionOrderNumberKey = bsonutil.MustHaveTag(AlertRecord{}, "RevisionOrderNumber") AlertTimeKey = bsonutil.MustHaveTag(AlertRecord{}, "AlertTime") )
Functions ¶
func ByFirstFailureInVariant ¶
func ByFirstFailureInVersion ¶
func ByLastFailureTransition ¶
ByPreviousFailureTransition finds the last alert record that was stored for a task/variant within a given project. This can be used to determine whether or not a newly detected failure transition should trigger an alert. If an alert was already sent for a failed task, which transitioned from a succsesfulwhose commit order number is
func InsertNewHostTemporaryExemptionExpirationRecord ¶
InsertNewTemporaryExemptionExpirationRecord inserts a new alert record for a temporary exemption that is about to exipre.
Types ¶
type AlertRecord ¶
type AlertRecord struct { Id mgobson.ObjectId `bson:"_id"` SubscriptionID string `bson:"subscription_id"` Type string `bson:"type"` HostId string `bson:"host_id,omitempty"` VolumeId string `bson:"volume_id,omitempty"` TaskId string `bson:"task_id,omitempty"` TaskStatus string `bson:"task_status,omitempty"` ProjectId string `bson:"project_id,omitempty"` VersionId string `bson:"version_id,omitempty"` TaskName string `bson:"task_name,omitempty"` Variant string `bson:"variant,omitempty"` TestName string `bson:"test_name,omitempty"` RevisionOrderNumber int `bson:"order,omitempty"` AlertTime time.Time `bson:"alert_time,omitempty"` }
func FindByFirstRegressionInVersion ¶
func FindByFirstRegressionInVersion(subscriptionID, versionId string) (*AlertRecord, error)
func FindByLastTaskRegressionByTest ¶
func FindByLastTaskRegressionByTest(subscriptionID, testName, taskDisplayName, variant, projectID string) (*AlertRecord, error)
func FindByMostRecentTemporaryExemptionExpirationWithHours ¶
func FindByMostRecentTemporaryExemptionExpirationWithHours(hostID string, hours int) (*AlertRecord, error)
FindByMostRecentTemporaryExemptionExpirationWithHours finds the most recent alert record for a spawn host's temporary exemption that is about to expire.
func FindBySpawnHostExpirationWithHours ¶
func FindBySpawnHostExpirationWithHours(hostID string, hours int) (*AlertRecord, error)
func FindByTaskRegressionByTaskTest ¶
func FindByTaskRegressionByTaskTest(subscriptionID, testName, taskDisplayName, variant, projectID, taskID string) (*AlertRecord, error)
func FindByTaskRegressionTestAndOrderNumber ¶
func FindByTaskRegressionTestAndOrderNumber(subscriptionID, testName, taskDisplayName, variant, projectID string, revisionOrderNumber int) (*AlertRecord, error)
func FindByVolumeExpirationWithHours ¶
func FindByVolumeExpirationWithHours(volumeID string, hours int) (*AlertRecord, error)
func FindOne ¶
func FindOne(query db.Q) (*AlertRecord, error)
FindOne gets one AlertRecord for the given query.
func (*AlertRecord) Insert ¶
func (ar *AlertRecord) Insert() error
func (*AlertRecord) MarshalBSON ¶
func (ar *AlertRecord) MarshalBSON() ([]byte, error)
func (*AlertRecord) UnmarshalBSON ¶
func (ar *AlertRecord) UnmarshalBSON(in []byte) error