Skip to content

Commit

Permalink
Merge pull request #417 from forta-protocol/remove-log-and-condense-m…
Browse files Browse the repository at this point in the history
…etric

Remove log and condense metric
  • Loading branch information
stevenlanders authored Feb 11, 2022
2 parents c314c27 + c1990b4 commit 9911452
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions services/scanner/agentpool/agent_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (ap *AgentPool) SendEvaluateTxRequest(req *protocol.EvaluateTxRequest) {
agents := ap.agents
ap.mu.RUnlock()

var metricsList []*protocol.AgentMetric
for _, agent := range agents {
if !agent.IsReady() || !agent.ShouldProcessBlock(req.Event.Block.BlockNumber) {
continue
Expand All @@ -139,15 +138,13 @@ func (ap *AgentPool) SendEvaluateTxRequest(req *protocol.EvaluateTxRequest) {
ap.discardAgent(agent)
case agent.TxRequestCh() <- req:
default: // do not try to send if the buffer is full
lg.WithField("agent", agent.Config().ID).Warn("agent tx request buffer is full - skipping")
metricsList = append(metricsList, metrics.CreateAgentMetric(agent.Config().ID, metrics.MetricTxDrop, 1))
lg.WithField("agent", agent.Config().ID).Debug("agent tx request buffer is full - skipping")
}
lg.WithFields(log.Fields{
"agent": agent.Config().ID,
"duration": time.Since(startTime),
}).Debug("sent tx request to evalTxCh")
}
metrics.SendAgentMetrics(ap.msgClient, metricsList)
lg.WithFields(log.Fields{
"duration": time.Since(startTime),
}).Debug("Finished SendEvaluateTxRequest")
Expand Down

0 comments on commit 9911452

Please sign in to comment.