good morning!!!!

Skip to content
Snippets Groups Projects
Commit 9b1543c2 authored by Elad's avatar Elad Committed by Anton Evangelatov
Browse files

swarm/network: update syncer metrics

parent 297fa185
No related branches found
No related tags found
No related merge requests found
...@@ -111,13 +111,13 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6 ...@@ -111,13 +111,13 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
timerC <-chan time.Time timerC <-chan time.Time
) )
defer func() { defer func(start time.Time) {
metrics.GetOrRegisterResettingTimer("syncer.set-next-batch.total-time", nil).UpdateSince(batchStart) metrics.GetOrRegisterResettingTimer("syncer.set-next-batch.total-time", nil).UpdateSince(start)
metrics.GetOrRegisterCounter("syncer.set-next-batch.batch-size", nil).Inc(int64(batchSize)) metrics.GetOrRegisterCounter("syncer.set-next-batch.batch-size", nil).Inc(int64(batchSize))
if timer != nil { if timer != nil {
timer.Stop() timer.Stop()
} }
}() }(batchStart)
for iterate := true; iterate; { for iterate := true; iterate; {
select { select {
...@@ -167,7 +167,6 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6 ...@@ -167,7 +167,6 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
log.Debug("syncer pull subscription timer expired", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID) log.Debug("syncer pull subscription timer expired", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
case <-s.quit: case <-s.quit:
iterate = false iterate = false
metrics.GetOrRegisterCounter("syncer.set-next-batch.quit-sig", nil).Inc(1)
log.Debug("syncer pull subscription - quit received", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID) log.Debug("syncer pull subscription - quit received", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment