Documentation ¶
Index ¶
- type BuildletPriority
- type Item
- type ItemStats
- type Quota
- func (q *Quota) AwaitQueue(ctx context.Context, cost int, si *SchedItem) error
- func (q *Quota) Empty() bool
- func (q *Quota) Enqueue(cost int, si *SchedItem) *Item
- func (q *Quota) Len() int
- func (q *Quota) Quotas() Usage
- func (q *Quota) ReturnQuota(v int)
- func (q *Quota) ToExported() *QuotaStats
- func (q *Quota) UpdateLimit(limit int)
- func (q *Quota) UpdateQuotas(used, limit int)
- func (q *Quota) UpdateUntracked(n int)
- type QuotaStats
- type SchedItem
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildletPriority ¶
type BuildletPriority int
const ( // PriorityUrgent is reserved for Go releases. PriorityUrgent BuildletPriority = iota PriorityInteractive PriorityAutomated PriorityBatch )
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
An Item is something we manage in a priority buildletQueue.
func (*Item) Await ¶
Await blocks until the Item holds the necessary quota amount, or the context is cancelled.
On success, the caller must call ReturnQuota() to release the quota.
func (*Item) ReturnQuota ¶
func (i *Item) ReturnQuota()
ReturnQuota returns quota to the Queue. ReturnQuota is a no-op if the item has never been popped.
type Quota ¶
type Quota struct {
// contains filtered or unexported fields
}
Quota manages a queue for a single quota.
func (*Quota) AwaitQueue ¶
AwaitQueue enqueues a build and returns once the item is unblocked by quota, by order of minimum priority.
If the provided context is cancelled before popping, the item is removed from the queue and an error is returned.
func (*Quota) Enqueue ¶
Enqueue a build and return an Item. See Item's documentation for waiting and releasing quota.
func (*Quota) ReturnQuota ¶
ReturnQuota decrements the used quota value by v.
func (*Quota) ToExported ¶
func (q *Quota) ToExported() *QuotaStats
func (*Quota) UpdateLimit ¶
UpdateLimit updates the limit values on the queue.
func (*Quota) UpdateQuotas ¶
UpdateQuotas updates the limit and used values on the queue.
func (*Quota) UpdateUntracked ¶
type QuotaStats ¶
type SchedItem ¶
type SchedItem struct { buildgo.BuilderRev // not set for gomote HostType string IsRelease bool IsGomote bool IsTry bool IsHelper bool Repo string Branch string // the Go repository branch // CommitTime is the latest commit date of the relevant repos // that make up the work being tested. (For example, x/foo // being tested against master can have either x/foo commit // being newer, or master being newer). CommitTime time.Time RequestTime time.Time User string }
SchedItem is a specification of a requested buildlet in its exported fields, and internal scheduler state used while waiting for that buildlet.
SchedItem is safe for copying.
func (*SchedItem) Less ¶
Less returns a boolean value of whether SchedItem is more important than the provided SchedItem.
func (*SchedItem) Priority ¶
func (s *SchedItem) Priority() BuildletPriority
Priority returns the BuildletPriority for a SchedItem.