Skip to content

Commit

Permalink
metrics: metrify cache account reads (#1914)
Browse files Browse the repository at this point in the history
  • Loading branch information
carneiro-cw authored Dec 12, 2024
1 parent a50187d commit 445de14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/eth/storage/stratus_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ impl Storage for StratusStorage {

let account = 'query: {
if point_in_time.is_pending() {
if let Some(account) = self.cache.get_account(address) {
if let Some(account) = timed(|| self.cache.get_account(address)).with(|m| {
metrics::inc_storage_read_account(m.elapsed, label::CACHE, point_in_time, true);
}) {
tracing::debug!(storage = %label::CACHE, %address, ?account, "account found in cache");
return Ok(account);
};

Expand Down

0 comments on commit 445de14

Please sign in to comment.