feature: Add a verified blocks metrics counter

We have a counter for pending "download and verify" futures. But these
futures are spawned, so they can complete in any order. They can also
complete before we receive their results.
This commit is contained in:
teor 2020-08-07 18:32:27 +10:00
parent 6aeefcee8b
commit faac50697c
1 changed files with 3 additions and 1 deletions

View File

@ -422,7 +422,9 @@ where
};
metrics::counter!("sync.downloaded_blocks", 1);
verifier.ready_and().await?.call(block).await
let result = verifier.ready_and().await?.call(block).await;
metrics::counter!("sync.verified_blocks", 1);
result
})
.instrument(span);
self.pending_blocks.push(task);