alertrecord

package
Version: v0.0.0-...-a204096 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collection = "alertrecord"
)

Variables

View Source
var (
	TaskFailedId           = "task_failed"
	FirstVersionFailureId  = "first_version_failure"
	FirstVariantFailureId  = "first_variant_failure"
	FirstTaskTypeFailureId = "first_tasktype_failure"
	TaskFailTransitionId   = "task_transition_failure"
	LastRevisionNotFound   = "last_revision_not_found"
)

Task triggers

View Source
var (
	SpawnFailed                = "spawn_failed"
	SpawnHostTwoHourWarning    = "spawn_twohour"
	SpawnHostTwelveHourWarning = "spawn_twelvehour"
	SlowProvisionWarning       = "slow_provision"
	ProvisionFailed            = "provision_failed"
)

Host triggers

View Source
var (
	IdKey                  = bsonutil.MustHaveTag(AlertRecord{}, "Id")
	TypeKey                = bsonutil.MustHaveTag(AlertRecord{}, "Type")
	TaskIdKey              = bsonutil.MustHaveTag(AlertRecord{}, "TaskId")
	HostIdKey              = bsonutil.MustHaveTag(AlertRecord{}, "HostId")
	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")
)

Functions

func ByFirstFailureInTaskType

func ByFirstFailureInTaskType(versionId, taskName string) db.Q

func ByFirstFailureInVariant

func ByFirstFailureInVariant(versionId, variant string) db.Q

func ByFirstFailureInVersion

func ByFirstFailureInVersion(projectId, versionId string) db.Q

func ByHostAlertRecordType

func ByHostAlertRecordType(hostId, triggerId string) db.Q

func ByLastFailureTransition

func ByLastFailureTransition(taskName, variant, projectId string) db.Q

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 ByLastRevNotFound

func ByLastRevNotFound(projectId, versionId string) db.Q

Types

type AlertRecord

type AlertRecord struct {
	Id                  bson.ObjectId `bson:"_id"`
	Type                string        `bson:"type"`
	HostId              string        `bson:"host_id,omitempty"`
	TaskId              string        `bson:"task_id,omitempty"`
	ProjectId           string        `bson:"project_id,omitempty"`
	VersionId           string        `bson:"version_id,omitempty"`
	TaskName            string        `bson:"task_name,omitempty"`
	Variant             string        `bson:"variant,omitempty"`
	RevisionOrderNumber int           `bson:"order,omitempty"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL