Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
WIP track recoverables with maps

Track time

Add logs

Timestamp recover

Bump recovery batch size
  • Loading branch information
ferglor committed Jul 19, 2024
1 parent 4565fef commit bd08023
Show file tree
Hide file tree
Showing 4 changed files with 1,352 additions and 1,311 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const (
logTriggerStateDropped logTriggerState = iota
// the log was enqueued by the buffer
logTriggerStateEnqueued
// the log was visited/dequeued from the buffer
// the log was queuedForRecovery/dequeued from the buffer
logTriggerStateDequeued
)

Expand All @@ -293,7 +293,7 @@ type logTriggerStateEntry struct {
}

// upkeepLogQueue is a priority queue for logs associated to a specific upkeep.
// It keeps track of the logs that were already visited and the capacity of the queue.
// It keeps track of the logs that were already queuedForRecovery and the capacity of the queue.
type upkeepLogQueue struct {
lggr logger.Logger

Expand Down Expand Up @@ -412,7 +412,7 @@ func (q *upkeepLogQueue) enqueue(blockThreshold int64, logsToAdd ...logpoller.Lo
if added > 0 {
q.orderLogs()
dropped = q.clean(blockThreshold)
q.lggr.Debugw("Enqueued logs", "added", added, "dropped", dropped, "blockThreshold", blockThreshold, "q size", len(q.logs), "visited size", len(q.states))
q.lggr.Debugw("Enqueued logs", "added", added, "dropped", dropped, "blockThreshold", blockThreshold, "q size", len(q.logs), "queuedForRecovery size", len(q.states))
}

prommetrics.AutomationLogBufferFlow.WithLabelValues(prommetrics.LogBufferFlowDirectionIngress).Add(float64(added))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func (p *logEventProvider) getLogsFromBuffer(latestBlock int64) []ocr2keepers.Up
}

payloads = p.minimumCommitmentDequeue(latestBlock, start)

// if we have remaining capacity following minimum commitment dequeue, perform a best effort dequeue
if len(payloads) < MaxPayloads {
payloads = p.bestEffortDequeue(latestBlock, start, payloads)
Expand Down
Loading

0 comments on commit bd08023

Please sign in to comment.