Documentation
¶
Index ¶
- Constants
- Variables
- func AdminEventsBefore(before time.Time, n int) db.Q
- func AllRecentHostEventsMatchStatus(hostId string, n int, status string) bool
- func ByGuid(guid string) db.Q
- func CountProcessEvents(taskID string) (int, error)
- func CountSystemEvents(taskId string) (int, error)
- func CountUnprocessedEvents() (int, error)
- func DistroEventsForId(id string) db.Q
- func DistroEventsInOrder(id string) db.Q
- func HostEventsForId(id string) db.Q
- func HostEventsInOrder(id string) db.Q
- func IsValidOwnerType(in string) bool
- func LogAdminEvent(section string, before, after evergreen.ConfigSection, user string) error
- func LogBuildStateChangeEvent(id, status string)
- func LogDisplayTaskFinished(taskId string, execution int, status string)
- func LogDistroAdded(distroId, userId string, data interface{})
- func LogDistroEvent(distroId string, eventType string, eventData DistroEventData)
- func LogDistroModified(distroId, userId string, data interface{})
- func LogDistroRemoved(distroId, userId string, data interface{})
- func LogExpirationWarningSent(hostID string)
- func LogHostAgentDeployFailed(hostId string, err error)
- func LogHostAgentDeployed(hostId string)
- func LogHostCreated(hostId string)
- func LogHostDNSNameSet(hostId string, dnsName string)
- func LogHostEvent(hostId string, eventType string, eventData HostEventData)
- func LogHostProvisionError(hostId string)
- func LogHostProvisioned(hostId string)
- func LogHostRunningTaskCleared(hostId string, taskId string)
- func LogHostRunningTaskSet(hostId string, taskId string)
- func LogHostStarted(hostId string)
- func LogHostStatusChanged(hostId, oldStatus, newStatus, user string, logs string)
- func LogHostTaskPidSet(hostId string, taskPid string)
- func LogHostTeardown(hostId, teardownLogs string, success bool, duration time.Duration)
- func LogHostTerminatedExternally(hostId string)
- func LogJiraIssueCreated(taskId string, execution int, jiraIssue string)
- func LogManyTaskAbortRequests(taskIds []string, userId string)
- func LogMonitorOperation(hostId string, op string)
- func LogPatchStateChangeEvent(id, newStatus string)
- func LogProvisionFailed(hostId string, setupLogs string)
- func LogSchedulerEvent(eventData SchedulerEventData)
- func LogTaskAbortRequest(taskId string, execution int, userId string)
- func LogTaskActivated(taskId string, execution int, userId string)
- func LogTaskCreated(taskId string, execution int)
- func LogTaskDeactivated(taskId string, execution int, userId string)
- func LogTaskDependenciesOverridden(taskId string, execution int, userID string)
- func LogTaskDispatched(taskId string, execution int, hostId string)
- func LogTaskFinished(taskId string, execution int, hostId, status string)
- func LogTaskPriority(taskId string, execution int, user string, priority int64)
- func LogTaskProcessData(taskId string, procs []*message.ProcessInfo)
- func LogTaskRestarted(taskId string, execution int, userId string)
- func LogTaskScheduled(taskId string, execution int, scheduledTime time.Time)
- func LogTaskStarted(taskId string, execution int)
- func LogTaskSystemData(taskId string, info *message.SystemInfo)
- func LogTaskUndispatched(taskId string, execution int, hostId string)
- func LogVersionStateChangeEvent(id, newStatus string)
- func MostRecentDistroEvents(id string, n int) db.Q
- func MostRecentHostEvents(id string, n int) db.Q
- func MostRecentTaskEvents(id string, n int) db.Q
- func NewEventFromType(resourceType string) interface{}
- func RecentAdminEvents(n int) db.Q
- func RecentSchedulerEvents(distroId string, n int) db.Q
- func RemoveSubscription(id string) error
- func RevertConfig(guid string, user string) error
- func SchedulerEventsForId(distroID string) db.Q
- func TaskEventsForId(id string) db.Q
- func TaskEventsInOrder(id string) db.Q
- func TaskProcessInfoEvents(taskID string, ts time.Time, limit, sort int) db.Q
- func TaskSystemInfoEvents(taskID string, ts time.Time, limit, sort int) db.Q
- func UpdateExecutions(hostId, taskId string, execution int) error
- type AdminEventData
- type BuildEventData
- type ConfigDataChange
- type DBEventLogger
- type DistroEventData
- type EventLogEntry
- type EventLogger
- type GithubPullRequestSubscriber
- type HostEventData
- type JIRAIssueSubscriber
- type OwnerType
- type PatchEventData
- type RecentHostAgentDeploys
- type SchedulerEventData
- type Selector
- type Subscriber
- type Subscription
- func CreateOrUpdateImplicitSubscription(subscriptionType string, id string, subscriber Subscriber, user string) (*Subscription, error)
- func FindSubscriptionByID(id string) (*Subscription, error)
- func FindSubscriptions(resourceType string, selectors []Selector) ([]Subscription, error)
- func FindSubscriptionsByOwner(owner string, ownerType OwnerType) ([]Subscription, error)
- func NewBuildBreakSubscriptionByOwner(owner string, sub Subscriber) Subscription
- func NewBuildOutcomeSubscriptionByVersion(versionID string, sub Subscriber) Subscription
- func NewPatchOutcomeSubscription(id string, sub Subscriber) Subscription
- func NewPatchOutcomeSubscriptionByOwner(owner string, sub Subscriber) Subscription
- func NewSpawnHostOutcomeByOwner(owner string, sub Subscriber) Subscription
- func NewSpawnhostExpirationSubscription(owner string, sub Subscriber) Subscription
- func NewSubscriptionByOwner(owner string, sub Subscriber, resourceType, trigger string) Subscription
- type TaskEventData
- type TaskProcessResourceData
- type TaskQueueInfo
- type TaskSystemResourceData
- type VersionEventData
- type WebhookSubscriber
Constants ¶
const ( ResourceTypeAdmin = "ADMIN" EventTypeValueChanged = "CONFIG_VALUE_CHANGED" )
const ( ResourceTypeBuild = "BUILD" BuildStateChange = "STATE_CHANGE" )
const ( // resource type ResourceTypeDistro = "DISTRO" // event types EventDistroAdded = "DISTRO_ADDED" EventDistroModified = "DISTRO_MODIFIED" EventDistroRemoved = "DISTRO_REMOVED" )
const ( AllLogCollection = "event_log" TaskLogCollection = "task_event_log" )
const ( // resource type ResourceTypeHost = "HOST" // event types EventHostCreated = "HOST_CREATED" EventHostStarted = "HOST_STARTED" EventHostAgentDeployed = "HOST_AGENT_DEPLOYED" EventHostAgentDeployFailed = "HOST_AGENT_DEPLOY_FAILED" EventHostStatusChanged = "HOST_STATUS_CHANGED" EventHostDNSNameSet = "HOST_DNS_NAME_SET" EventHostProvisionError = "HOST_PROVISION_ERROR" EventHostProvisionFailed = "HOST_PROVISION_FAILED" EventHostProvisioned = "HOST_PROVISIONED" EventHostRunningTaskSet = "HOST_RUNNING_TASK_SET" EventHostRunningTaskCleared = "HOST_RUNNING_TASK_CLEARED" EventHostTaskPidSet = "HOST_TASK_PID_SET" EventHostMonitorFlag = "HOST_MONITOR_FLAG" EventTaskFinished = "HOST_TASK_FINISHED" EventHostTeardown = "HOST_TEARDOWN" EventHostTerminatedExternally = "HOST_TERMINATED_EXTERNALLY" EventHostExpirationWarningSent = "HOST_EXPIRATION_WARNING_SENT" )
const ( ResourceTypePatch = "PATCH" PatchStateChange = "STATE_CHANGE" )
const ( // resource type ResourceTypeScheduler = "SCHEDULER" // event types EventSchedulerRun = "SCHEDULER_RUN" )
const ( GithubPullRequestSubscriberType = "github_pull_request" JIRAIssueSubscriberType = "jira-issue" JIRACommentSubscriberType = "jira-comment" EvergreenWebhookSubscriberType = "evergreen-webhook" EmailSubscriberType = "email" SlackSubscriberType = "slack" )
const ( OwnerTypePerson OwnerType = "person" OwnerTypeProject OwnerType = "project" TaskDurationKey = "task-duration-secs" TaskPercentChangeKey = "task-percent-change" BuildDurationKey = "build-duration-secs" BuildPercentChangeKey = "build-percent-change" VersionDurationKey = "version-duration-secs" VersionPercentChangeKey = "version-percent-change" ImplicitSubscriptionPatchOutcome = "patch-outcome" ImplicitSubscriptionBuildBreak = "build-break" ImplicitSubscriptionSpawnhostExpiration = "spawnhost-expiration" ImplicitSubscriptionSpawnHostOutcome = "spawnhost-outcome" )
const ( // resource type ResourceTypeTask = "TASK" // event types TaskCreated = "TASK_CREATED" TaskDispatched = "TASK_DISPATCHED" TaskUndispatched = "TASK_UNDISPATCHED" TaskStarted = "TASK_STARTED" TaskFinished = "TASK_FINISHED" TaskRestarted = "TASK_RESTARTED" TaskActivated = "TASK_ACTIVATED" TaskDeactivated = "TASK_DEACTIVATED" TaskAbortRequest = "TASK_ABORT_REQUEST" TaskScheduled = "TASK_SCHEDULED" TaskPriorityChanged = "TASK_PRIORITY_CHANGED" TaskJiraAlertCreated = "TASK_JIRA_ALERT_CREATED" TaskDepdendenciesOverridden = "TASK_DEPENDENCIES_OVERRIDDEN" )
const ( EventTaskSystemInfo = "TASK_SYSTEM_INFO" EventTaskProcessInfo = "TASK_PROCESS_INFO" )
const ( ResourceTypeVersion = "VERSION" VersionStateChange = "STATE_CHANGE" )
const (
SubscriptionsCollection = "subscriptions"
)
Variables ¶
var ( TimestampKey = bsonutil.MustHaveTag(EventLogEntry{}, "Timestamp") ResourceIdKey = bsonutil.MustHaveTag(EventLogEntry{}, "ResourceId") ResourceTypeKey = bsonutil.MustHaveTag(EventLogEntry{}, "ResourceType") TypeKey = bsonutil.MustHaveTag(EventLogEntry{}, "EventType") DataKey = bsonutil.MustHaveTag(EventLogEntry{}, "Data") )
var ( TaskSystemResourceDataSysInfoKey = bsonutil.MustHaveTag(TaskSystemResourceData{}, "SystemInfo") SysInfoCPUKey = bsonutil.MustHaveTag(message.SystemInfo{}, "CPU") SysInfoCPUPercentKey = bsonutil.MustHaveTag(message.SystemInfo{}, "CPUPercent") SysInfoNumCPUKey = bsonutil.MustHaveTag(message.SystemInfo{}, "NumCPU") SysInfoVMStatKey = bsonutil.MustHaveTag(message.SystemInfo{}, "VMStat") SysInfoNetStatKey = bsonutil.MustHaveTag(message.SystemInfo{}, "NetStat") SysInfoPartionsKey = bsonutil.MustHaveTag(message.SystemInfo{}, "Partitions") SysInfoUsageKey = bsonutil.MustHaveTag(message.SystemInfo{}, "Usage") SysInfoIoStatKey = bsonutil.MustHaveTag(message.SystemInfo{}, "IOStat") SysInfoErrorsKey = bsonutil.MustHaveTag(message.SystemInfo{}, "Errors") SysInfoCPUTimesStatCPUKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "CPU") SysInfoCPUTimesStatUserKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "User") SysInfoCPUTimesStatSystemKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "System") SysInfoCPUTimesStatIdleKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Idle") SysInfoCPUTimesStatNiceKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Nice") SysInfoCPUTimesStatIowaitKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Iowait") SysInfoCPUTimesStatIrqKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Irq") SysInfoCPUTimesStatSoftirqKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Softirq") SysInfoCPUTimesStatStealKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Steal") SysInfoCPUTimesStatGuestNiceKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "GuestNice") SysInfoCPUTimesStatGuestStolenKey = bsonutil.MustHaveTag(message.SystemInfo{}.CPU, "Stolen") SysInfoVMStatTotalKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Total") SysInfoVMStatAvailableKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Available") SysInfoVMStatUsedKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Used") SysInfoVMStatUsedPercentKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "UsedPercent") SysInfoVMStatFreeKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Free") SysInfoVMStatActiveKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Active") SysInfoVMStatInactiveKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Inactive") SysInfoVMStatWiredKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Wired") SysInfoVMStatBuffersKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Buffers") SysInfoVMStatCachedKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Cached") SysInfoVMStatWritebackKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Writeback") SysInfoVMStatDirtyKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Dirty") SysInfoVMStatWritebackTmpKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "WritebackTmp") SysInfoVMStatSlabKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "Slab") SysInfoVMStatPageTablesKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "PageTables") SysInfoVMStatSwapCachedKey = bsonutil.MustHaveTag(message.SystemInfo{}.VMStat, "SwapCached") SysInfoNetIOCountersNameKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Name") SysInfoNetIOCountersBytesSentKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "BytesSent") SysInfoNetIOCountersBytesRecvKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "BytesRecv") SysInfoNetIOCountersPacketsSentKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "PacketsSent") SysInfoNetIOCountersPacketsRecvKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "PacketsRecv") SysInfoNetIOCountersErrinKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Errin") SysInfoNetIOCountersErroutKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Errout") SysInfoNetIOCountersDropinKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Dropin") SysInfoNetIOCountersDropoutKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Dropout") SysInfoNetIOCountersFifoinKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Fifoin") SysInfoNetIOCountersFifooutKey = bsonutil.MustHaveTag(message.SystemInfo{}.NetStat, "Fifoout") SysInfoPartitionStatDeviceKey = bsonutil.MustHaveTag(message.SystemInfo{}.Partitions, "Device") SysInfoPartitionStatMountpointKey = bsonutil.MustHaveTag(message.SystemInfo{}.Partitions, "Mountpoint") SysInfoPartitionStatFSTypeKey = bsonutil.MustHaveTag(message.SystemInfo{}.Partitions, "Fstype") SysInfoPartitionStatOptsKey = bsonutil.MustHaveTag(message.SystemInfo{}.Partitions, "Opts") SysInfoUsageStatPathKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "Path") SysInfoUsageStatFSTypeKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "Fstype") SysInfoUsageStatTotalKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "Total") SysInfoUsageStatFreeKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "Free") SysInfoUsageStatUsedKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "Used") SysInfoUsageStatUsedPercentKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "UsedPercent") SysInfoUsageStatInodesTotalKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "InodesTotal") SysInfoUsageStatInodesUsedKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "InodesUsed") SysInfoUsageStatInodesFreeKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "InodesFree") SysInfoUsageStatInodesUsedPercentKey = bsonutil.MustHaveTag(message.SystemInfo{}.Usage, "InodesUsedPercent") SysInfoDiskIOCountersReadCountKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "ReadCount") SysInfoDiskIOCountersMergedReadCountKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "MergedReadCount") SysInfoDiskIOCountersWriteCountKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "WriteCount") SysInfoDiskIOCountersMergedWriteCountKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "MergedWriteCount") SysInfoDiskIOCountersReadBytesKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "ReadBytes") SysInfoDiskIOCountersWriteBytesKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "WriteBytes") SysInfoDiskIOCountersReadTimeKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "ReadTime") SysInfoDiskIOCountersWriteTimeKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "WriteTime") SysInfoDiskIOCountersIopsInProgressKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "IopsInProgress") SysInfoDiskIOCountersIoTimeKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "IoTime") SysInfoDiskIOCountersWeigtedIoKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "WeightedIO") SysInfoDiskIOCountersNameKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "Name") SysInfoDiskIOCountersSerialNumberKey = bsonutil.MustHaveTag(message.SystemInfo{}.IOStat, "SerialNumber") )
var ( TaskProcessResourceDataSysInfoKey = bsonutil.MustHaveTag(TaskProcessResourceData{}, "Processes") ProcInfoPidKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Pid") ProcInfoParentKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Parent") ProcInfoThreadsKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Threads") ProcInfoCommandKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Command") ProcInfoErrorsKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Errors") ProcInfoCPUKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "CPU") ProcInfoIoStatKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "IoStat") ProcInfoMemoryKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "Memory") ProcInfoMemoryPlatformKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "MemoryPlatform") ProcInfoNetStatKey = bsonutil.MustHaveTag(message.ProcessInfo{}, "NetStat") ProcInfoCPUTimesStatCPUKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "CPU") ProcInfoCPUTimesStatUserKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "User") ProcInfoCPUTimesStatSystemKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "System") ProcInfoCPUTimesStatIdleKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Idle") ProcInfoCPUTimesStatNiceKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Nice") ProcInfoCPUTimesStatIowaitKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Iowait") ProcInfoCPUTimesStatIrqKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Irq") ProcInfoCPUTimesStatSoftirqKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Softirq") ProcInfoCPUTimesStatStealKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Steal") ProcInfoCPUTimesStatGuestNiceKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "GuestNice") ProcInfoCPUTimesStatGuestStolenKey = bsonutil.MustHaveTag(message.ProcessInfo{}.CPU, "Stolen") ProcInfoIoStatReadCountKey = bsonutil.MustHaveTag(message.ProcessInfo{}.IoStat, "ReadCount") ProcInfoIoStatReadBytesKey = bsonutil.MustHaveTag(message.ProcessInfo{}.IoStat, "ReadBytes") ProcInfoIoStatWriteCountKey = bsonutil.MustHaveTag(message.ProcessInfo{}.IoStat, "WriteCount") ProcInfoIoStatWriteBytesKey = bsonutil.MustHaveTag(message.ProcessInfo{}.IoStat, "WriteBytes") ProcInfoNetStatNameKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Name") ProcInfoNetStatBytesSentKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "BytesSent") ProcInfoNetStatBytesRecvKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "BytesRecv") ProcInfoNetStatPacketsSentKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "PacketsSent") ProcInfoNetStatPacketsRecvKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "PacketsRecv") ProcInfoNetStatErrinKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Errin") ProcInfoNetStatErroutKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Errout") ProcInfoNetStatDropinKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Dropin") ProcInfoNetStatDropoutKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Dropout") ProcInfoNetStatFifoinKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Fifoin") ProcInfoNetStatFifooutKey = bsonutil.MustHaveTag(message.ProcessInfo{}.NetStat, "Fifoout") ProcInfoMemInfoStatRSSKey = bsonutil.MustHaveTag(message.ProcessInfo{}.Memory, "RSS") ProcInfoMemInfoStatVMSKey = bsonutil.MustHaveTag(message.ProcessInfo{}.Memory, "VMS") ProcInfoMemInfoStatSwapKey = bsonutil.MustHaveTag(message.ProcessInfo{}.Memory, "Swap") )
Functions ¶
func CountProcessEvents ¶
CountProcessEvents returns the total number of process tree metrics events captured for the specified task. If taskId is "", then this will return a count of all process metrics captured.
func CountSystemEvents ¶
CountSystemEvents returns the total number of system metrics events captured for the specified task. If taskId is "", then this will return a count of all system events captured.
func CountUnprocessedEvents ¶
func DistroEventsInOrder ¶
func HostEventsInOrder ¶
func IsValidOwnerType ¶
func LogAdminEvent ¶
func LogAdminEvent(section string, before, after evergreen.ConfigSection, user string) error
func LogBuildStateChangeEvent ¶
func LogBuildStateChangeEvent(id, status string)
func LogDisplayTaskFinished ¶
func LogDistroAdded ¶
func LogDistroAdded(distroId, userId string, data interface{})
func LogDistroEvent ¶
func LogDistroEvent(distroId string, eventType string, eventData DistroEventData)
func LogDistroModified ¶
func LogDistroModified(distroId, userId string, data interface{})
func LogDistroRemoved ¶
func LogDistroRemoved(distroId, userId string, data interface{})
func LogExpirationWarningSent ¶
func LogExpirationWarningSent(hostID string)
func LogHostAgentDeployed ¶
func LogHostAgentDeployed(hostId string)
func LogHostCreated ¶
func LogHostCreated(hostId string)
func LogHostDNSNameSet ¶
func LogHostEvent ¶
func LogHostEvent(hostId string, eventType string, eventData HostEventData)
func LogHostProvisionError ¶
func LogHostProvisionError(hostId string)
LogHostProvisionError is used to log each failed provision attempt
func LogHostProvisioned ¶
func LogHostProvisioned(hostId string)
func LogHostRunningTaskSet ¶
func LogHostStarted ¶
func LogHostStarted(hostId string)
func LogHostStatusChanged ¶
func LogHostTaskPidSet ¶
func LogHostTeardown ¶
func LogHostTerminatedExternally ¶
func LogHostTerminatedExternally(hostId string)
func LogJiraIssueCreated ¶
func LogMonitorOperation ¶
func LogPatchStateChangeEvent ¶
func LogPatchStateChangeEvent(id, newStatus string)
func LogProvisionFailed ¶
LogProvisionFailed is used when Evergreen gives up on spawning a host after several retries
func LogSchedulerEvent ¶
func LogSchedulerEvent(eventData SchedulerEventData)
LogSchedulerEvent takes care of logging the statistics about the scheduler at a given time. The ResourceId is the time that the scheduler runs.
func LogTaskAbortRequest ¶
func LogTaskActivated ¶
func LogTaskCreated ¶
func LogTaskDeactivated ¶
func LogTaskDispatched ¶
func LogTaskFinished ¶
func LogTaskPriority ¶
func LogTaskProcessData ¶
func LogTaskProcessData(taskId string, procs []*message.ProcessInfo)
LogTaskProcessData saves a slice of ProcessInfo objects to the event log under the specified task.
func LogTaskRestarted ¶
func LogTaskScheduled ¶
func LogTaskStarted ¶
func LogTaskSystemData ¶
func LogTaskSystemData(taskId string, info *message.SystemInfo)
LogTaskSystemData saves a SystemInfo object to the event log for a task.
func LogTaskUndispatched ¶
func LogVersionStateChangeEvent ¶
func LogVersionStateChangeEvent(id, newStatus string)
func NewEventFromType ¶
func NewEventFromType(resourceType string) interface{}
func RecentAdminEvents ¶
Admin Events RecentAdminEvents returns the N most recent admin events
func RemoveSubscription ¶
func RevertConfig ¶
RevertConfig reverts one config section to the before state of the specified GUID in the event log
func TaskEventsInOrder ¶
func TaskProcessInfoEvents ¶
TaskProcessInfoEvents builds a query for process info, which returns information about each process (and children) spawned during task execution.
If the sort value is less than 0, the query will return all matching events that occur before the specified time, and otherwise will return all matching events that occur after the specified time.
func TaskSystemInfoEvents ¶
TaskSystemInfoEvents builds a query for system info, (e.g. aggregate information about the system as a whole) collected during a task.
If the sort value is less than 0, the query will return all matching events that occur before the specified time, and otherwise will return all matching events that occur after the specified time.
func UpdateExecutions ¶
UpdateExecutions updates host events to track multiple executions of the same task
Types ¶
type AdminEventData ¶
type AdminEventData struct { GUID string `bson:"guid" json:"guid"` User string `bson:"user" json:"user"` Section string `bson:"section" json:"section"` Changes ConfigDataChange `bson:"changes" json:"changes"` }
AdminEventData holds all potential data properties of a logged admin event
type BuildEventData ¶
type BuildEventData struct {
Status string `bson:"status" json:"status"`
}
type ConfigDataChange ¶
type ConfigDataChange struct { Before evergreen.ConfigSection `bson:"before" json:"before"` After evergreen.ConfigSection `bson:"after" json:"after"` }
type DBEventLogger ¶
type DBEventLogger struct {
// contains filtered or unexported fields
}
func NewDBEventLogger ¶
func NewDBEventLogger(collection string) *DBEventLogger
func (*DBEventLogger) LogEvent ¶
func (l *DBEventLogger) LogEvent(e *EventLogEntry) error
func (*DBEventLogger) LogManyEvents ¶
func (l *DBEventLogger) LogManyEvents(events []EventLogEntry) error
func (*DBEventLogger) MarkProcessed ¶
func (l *DBEventLogger) MarkProcessed(event *EventLogEntry) error
type DistroEventData ¶
type DistroEventData struct { DistroId string `bson:"d_id,omitempty" json:"d_id,omitempty"` UserId string `bson:"u_id,omitempty" json:"u_id,omitempty"` Data interface{} `bson:"dstr,omitempty" json:"dstr,omitempty"` }
DistroEventData implements EventData.
type EventLogEntry ¶
type EventLogEntry struct { ID string `bson:"_id" json:"-"` ResourceType string `bson:"r_type,omitempty" json:"resource_type,omitempty"` ProcessedAt time.Time `bson:"processed_at" json:"processed_at"` Timestamp time.Time `bson:"ts" json:"timestamp"` ResourceId string `bson:"r_id" json:"resource_id"` EventType string `bson:"e_type" json:"event_type"` Data interface{} `bson:"data" json:"data"` }
func Find ¶
func Find(coll string, query db.Q) ([]EventLogEntry, error)
Find takes a collection storing events and a query, generated by one of the query functions, and returns a slice of events.
func FindLastProcessedEvent ¶
func FindLastProcessedEvent() (*EventLogEntry, error)
func FindUnprocessedEvents ¶
func FindUnprocessedEvents() ([]EventLogEntry, error)
FindUnprocessedEvents returns all unprocessed events in AllLogCollection. Events are considered unprocessed if their "processed_at" time IsZero
func (*EventLogEntry) Processed ¶
func (e *EventLogEntry) Processed() (bool, time.Time)
Processed is whether or not this event has been processed. An event which has been processed has successfully have notifications intents created and stored, but does not indicate whether or not these notifications have been successfully sent to all recipients If true, the time is the time that this event was marked as processed. If false, time is the zero time
type EventLogger ¶
type EventLogger interface {
LogEvent(event *EventLogEntry) error
}
type GithubPullRequestSubscriber ¶
type GithubPullRequestSubscriber struct { Owner string `bson:"owner"` Repo string `bson:"repo"` PRNumber int `bson:"pr_number"` Ref string `bson:"ref"` }
func (*GithubPullRequestSubscriber) String ¶
func (s *GithubPullRequestSubscriber) String() string
type HostEventData ¶
type HostEventData struct { AgentRevision string `bson:"a_rev,omitempty" json:"agent_revision,omitempty"` OldStatus string `bson:"o_s,omitempty" json:"old_status,omitempty"` NewStatus string `bson:"n_s,omitempty" json:"new_status,omitempty"` Logs string `bson:"log,omitempty" json:"logs,omitempty"` Hostname string `bson:"hn,omitempty" json:"hostname,omitempty"` TaskId string `bson:"t_id,omitempty" json:"task_id,omitempty"` TaskExecution int `bson:"t_execution,omitempty" json:"task_execution,omitempty"` TaskPid string `bson:"t_pid,omitempty" json:"task_pid,omitempty"` TaskStatus string `bson:"t_st,omitempty" json:"task_status,omitempty"` Execution string `bson:"execution,omitempty" json:"execution,omitempty"` MonitorOp string `bson:"monitor_op,omitempty" json:"monitor,omitempty"` User string `bson:"usr" json:"user,omitempty"` Successful bool `bson:"successful,omitempty" json:"successful"` Duration time.Duration `bson:"duration,omitempty" json:"duration"` }
implements EventData
type JIRAIssueSubscriber ¶
type JIRAIssueSubscriber struct { Project string `bson:"project"` IssueType string `bson:"issue_type"` }
func (*JIRAIssueSubscriber) String ¶
func (s *JIRAIssueSubscriber) String() string
type PatchEventData ¶
type PatchEventData struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
}
type RecentHostAgentDeploys ¶
type RecentHostAgentDeploys struct { HostID string `bson:"host_id" json:"host_id" yaml:"host_id"` Count int `bson:"count" json:"count" yaml:"count"` Failed int `bson:"failed" json:"failed" yaml:"failed"` Success int `bson:"success" json:"success" yaml:"success"` HostStatusChanged int `bson:"host_status_changed" json:"host_status_changed" yaml:"host_status_changed"` Last string `bson:"last" json:"last" yaml:"last"` Total int `bson:"total" json:"total" yaml:"total"` message.Base `bson:"metadata" json:"metadata" yaml:"metadata"` }
RecentHostAgentDeploys is a type used to capture the results of an
func GetRecentAgentDeployStatuses ¶
func GetRecentAgentDeployStatuses(hostId string, n int) (*RecentHostAgentDeploys, error)
func (*RecentHostAgentDeploys) AllAttemptsFailed ¶
func (m *RecentHostAgentDeploys) AllAttemptsFailed() bool
func (*RecentHostAgentDeploys) LastAttemptFailed ¶
func (m *RecentHostAgentDeploys) LastAttemptFailed() bool
//////////////////////////////////////////////////////////////////////
Predicates to support error checking during the agent deploy process
func (*RecentHostAgentDeploys) Loggable ¶
func (m *RecentHostAgentDeploys) Loggable() bool
func (*RecentHostAgentDeploys) Raw ¶
func (m *RecentHostAgentDeploys) Raw() interface{}
func (*RecentHostAgentDeploys) String ¶
func (m *RecentHostAgentDeploys) String() string
type SchedulerEventData ¶
type SchedulerEventData struct { TaskQueueInfo TaskQueueInfo `bson:"tq_info" json:"task_queue_info"` DistroId string `bson:"d_id" json:"distro_id"` }
implements EventData
type Subscriber ¶
type Subscriber struct { Type string `bson:"type"` // sad violin Target interface{} `bson:"target"` }
func NewEmailSubscriber ¶
func NewEmailSubscriber(t string) Subscriber
func NewGithubStatusAPISubscriber ¶
func NewGithubStatusAPISubscriber(s GithubPullRequestSubscriber) Subscriber
func NewSlackSubscriber ¶
func NewSlackSubscriber(t string) Subscriber
func (*Subscriber) String ¶
func (s *Subscriber) String() string
func (*Subscriber) Validate ¶
func (s *Subscriber) Validate() error
type Subscription ¶
type Subscription struct { ID string `bson:"_id"` Type string `bson:"type"` Trigger string `bson:"trigger"` Selectors []Selector `bson:"selectors,omitempty"` RegexSelectors []Selector `bson:"regex_selectors,omitempty"` Subscriber Subscriber `bson:"subscriber"` OwnerType OwnerType `bson:"owner_type"` Owner string `bson:"owner"` TriggerData map[string]string `bson:"trigger_data,omitempty"` }
func CreateOrUpdateImplicitSubscription ¶
func CreateOrUpdateImplicitSubscription(subscriptionType string, id string, subscriber Subscriber, user string) (*Subscription, error)
func FindSubscriptionByID ¶
func FindSubscriptionByID(id string) (*Subscription, error)
func FindSubscriptions ¶
func FindSubscriptions(resourceType string, selectors []Selector) ([]Subscription, error)
FindSubscriptions finds all subscriptions of matching resourceType, and whose selectors match the selectors slice
func FindSubscriptionsByOwner ¶
func FindSubscriptionsByOwner(owner string, ownerType OwnerType) ([]Subscription, error)
func NewBuildBreakSubscriptionByOwner ¶
func NewBuildBreakSubscriptionByOwner(owner string, sub Subscriber) Subscription
func NewBuildOutcomeSubscriptionByVersion ¶
func NewBuildOutcomeSubscriptionByVersion(versionID string, sub Subscriber) Subscription
func NewPatchOutcomeSubscription ¶
func NewPatchOutcomeSubscription(id string, sub Subscriber) Subscription
func NewPatchOutcomeSubscriptionByOwner ¶
func NewPatchOutcomeSubscriptionByOwner(owner string, sub Subscriber) Subscription
func NewSpawnHostOutcomeByOwner ¶
func NewSpawnHostOutcomeByOwner(owner string, sub Subscriber) Subscription
func NewSpawnhostExpirationSubscription ¶
func NewSpawnhostExpirationSubscription(owner string, sub Subscriber) Subscription
func NewSubscriptionByOwner ¶
func NewSubscriptionByOwner(owner string, sub Subscriber, resourceType, trigger string) Subscription
func (*Subscription) String ¶
func (s *Subscription) String() string
func (*Subscription) Upsert ¶
func (s *Subscription) Upsert() error
func (*Subscription) Validate ¶
func (s *Subscription) Validate() error
type TaskEventData ¶
type TaskEventData struct { Execution int `bson:"execution" json:"execution"` HostId string `bson:"h_id,omitempty" json:"host_id,omitempty"` UserId string `bson:"u_id,omitempty" json:"user_id,omitempty"` Status string `bson:"s,omitempty" json:"status,omitempty"` JiraIssue string `bson:"jira,omitempty" json:"jira,omitempty"` Timestamp time.Time `bson:"ts,omitempty" json:"timestamp,omitempty"` Priority int64 `bson:"pri,omitempty" json:"priority,omitempty"` }
implements Data
type TaskProcessResourceData ¶
type TaskProcessResourceData struct { //TODO: EVG-3061 remove the following line ResourceType string `bson:"r_type,omitempty" json:"resource_type,omitempty"` Processes []*message.ProcessInfo `bson:"processes" json:"processes"` }
TaskProcessResourceData wraps a slice of grip/message.ProcessInfo structs in a type that implements the event.Data interface. ProcessInfo structs represent system resource usage information for a single process (PID).
type TaskQueueInfo ¶
type TaskSystemResourceData ¶
type TaskSystemResourceData struct { //TODO: EVG-3061 remove the following line ResourceType string `bson:"r_type,omitempty" json:"resource_type,omitempty"` SystemInfo *message.SystemInfo `bson:"system_info" json:"system_info" yaml:"system_info"` }
TaskSystemResourceData wraps a grip/message.SystemInfo struct in a type that implements the event.Data interface. SystemInfo structs capture aggregated system metrics (cpu, memory, network) for the system as a whole.
type VersionEventData ¶
type VersionEventData struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
}
type WebhookSubscriber ¶
func (*WebhookSubscriber) String ¶
func (s *WebhookSubscriber) String() string