Skip to content

Commit

Permalink
Remove logsInBuffer var
Browse files Browse the repository at this point in the history
  • Loading branch information
ogtownsend committed Feb 21, 2024
1 parent 9168f9d commit 1c179f9
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ type logEventBuffer struct {
blocks []fetchedBlock
// latestBlock is the latest block number seen
latestBlock int64
// logsInBuffer is the number of logs currently in the buffer
logsInBuffer int64
}

func newLogEventBuffer(lggr logger.Logger, size, numOfLogUpkeeps, fastExecLogsHigh int) *logEventBuffer {
Expand Down Expand Up @@ -233,7 +231,7 @@ func (b *logEventBuffer) enqueue(id *big.Int, logs ...logpoller.Log) int {
}
if added > 0 {
lggr.Debugw("Added logs to buffer", "addedLogs", added, "dropped", dropped, "latestBlock", latestBlock)
prommetrics.AutomationLogsInLogBuffer.Set(float64(atomic.AddInt64(&b.logsInBuffer, int64(added-dropped))))
prommetrics.AutomationLogsInLogBuffer.Add(float64(added - dropped))
}

return added - dropped
Expand Down Expand Up @@ -335,7 +333,7 @@ func (b *logEventBuffer) dequeueRange(start, end int64, upkeepLimit, totalLimit

if len(results) > 0 {
b.lggr.Debugw("Dequeued logs", "results", len(results), "start", start, "end", end)
prommetrics.AutomationLogsInLogBuffer.Set(float64(atomic.AddInt64(&b.logsInBuffer, -int64(len(results)))))
prommetrics.AutomationLogsInLogBuffer.Sub(float64(len(results)))
}

return results
Expand Down

0 comments on commit 1c179f9

Please sign in to comment.