MCPcopy Index your code
hub / github.com/coder/coder / Push

Method Push

agent/proto/resourcesmonitor/queue.go:43–49  ·  view source on GitHub ↗

Push adds a new item to the queue

(item Datapoint)

Source from the content-addressed store, hash-verified

41
42// Push adds a new item to the queue
43func (q *Queue) Push(item Datapoint) {
44 if len(q.items) >= q.size {
45 // Remove the first item (FIFO)
46 q.items = q.items[1:]
47 }
48 q.items = append(q.items, item)
49}
50
51func (q *Queue) IsFull() bool {
52 return len(q.items) == q.size

Callers 2

TestResourceMonitorQueueFunction · 0.95
StartMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestResourceMonitorQueueFunction · 0.76